Fix the problem that some keys of ClipColumnFamily may not be deleted (#11811)

Summary:
When executing ClipColumnFamily, if end_key is equal to largest_user_key in a file, this key will not be deleted. So we need to change less than to less than or equal to

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11811

Reviewed By: ajkr

Differential Revision: D49206936

Pulled By: cbi42

fbshipit-source-id: 3e8bcb7b52040a9b4d1176de727616cc298d3445
This commit is contained in:
马越 2023-09-14 13:36:39 -07:00 committed by Facebook GitHub Bot
parent 84d335b619
commit 3c27f56d0b
1 changed files with 1 additions and 1 deletions

View File

@ -5920,7 +5920,7 @@ Status DBImpl::ClipColumnFamily(ColumnFamilyHandle* column_family,
if (status.ok()) {
// Delete [clip_end_key, largest_use_key]
if (ucmp->Compare(end_key, largest_user_key) < 0) {
if (ucmp->Compare(end_key, largest_user_key) <= 0) {
status = DeleteRange(wo, column_family, end_key, largest_user_key);
if (status.ok()) {
status = Delete(wo, column_family, largest_user_key);