From 1a1f9f166093e36541df0886505d9a87a4fbb887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E8=B6=8A?= Date: Wed, 10 Jan 2024 14:34:12 -0800 Subject: [PATCH] Fix the compactRange with wrong cf handle when ClipColumnFamily (#12219) Summary: - **Context**: In ClipColumnFamily, the DeleteRange API will be used to delete data, and then CompactRange will be called for physical deletion. But now However, the ColumnFamilyHandle is not passed , so by default only the DefaultColumnFamily will be CompactRanged. Therefore, it may cause that the data in some sst files of CompactionRange cannot be physically deleted. - **In this change** Pass the ColumnFamilyHandle when call CompactRange Pull Request resolved: https://github.com/facebook/rocksdb/pull/12219 Reviewed By: ajkr Differential Revision: D52665162 Pulled By: cbi42 fbshipit-source-id: e8e997aa25ec4ca40e347be89edc7e84a7a0edce --- db/db_impl/db_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc index 36b18f9a2b8..1cd64eb1ad1 100644 --- a/db/db_impl/db_impl.cc +++ b/db/db_impl/db_impl.cc @@ -6280,7 +6280,7 @@ Status DBImpl::ClipColumnFamily(ColumnFamilyHandle* column_family, // last level to compact to and that range tombstones are not dropped // during non-bottommost compactions, calling CompactRange() on these two // ranges may not clear all range tombstones. - status = CompactRange(compact_options, nullptr, nullptr); + status = CompactRange(compact_options, column_family, nullptr, nullptr); } return status; }