diff --git a/be/src/storage/tablet_updates.cpp b/be/src/storage/tablet_updates.cpp index 14bdb823a49f9..61ff9723e5848 100644 --- a/be/src/storage/tablet_updates.cpp +++ b/be/src/storage/tablet_updates.cpp @@ -1789,9 +1789,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(); }