diff --git a/be/src/storage/tablet_updates.cpp b/be/src/storage/tablet_updates.cpp index 0ab48b4118e7b..3410700fb04f1 100644 --- a/be/src/storage/tablet_updates.cpp +++ b/be/src/storage/tablet_updates.cpp @@ -1468,9 +1468,13 @@ Status TabletUpdates::_do_compaction(std::unique_ptr* pinfo) { // 4. commit compaction EditVersion version; RETURN_IF_ERROR(_commit_compaction(pinfo, *output_rowset, &version)); - // already committed, so we can ignore timeout error here - std::unique_lock ul(_lock); - _wait_for_version(version, 120000, ul); + { + // already committed, so we can ignore timeout error here + std::unique_lock ul(_lock); + _wait_for_version(version, 120000, ul); + } + // Release metadata memory after rowsets have been compacted. + Rowset::close_rowsets(input_rowsets); return Status::OK(); }