Skip to content

Commit db019e1

Browse files
committed
fix: 尝试修复obdcompact error
漏传了 handles_[idx],导致非kMetaCF 的 CF 触发 force compact时,实际被 compact 的是 kMetaCF
1 parent f6ddc52 commit db019e1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/storage/src/redis.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,12 @@ Status Redis::LongestNotCompactionSstCompact(const DataType& option_type, std::v
400400
if (file_creation_time <
401401
static_cast<uint64_t>(now / 1000 - storageOptions.compact_param_.force_compact_file_age_seconds_) &&
402402
delete_ratio >= force_compact_min_ratio) {
403-
compact_result = db_->CompactRange(default_compact_range_options_, &start_key, &stop_key);
403+
compact_result = db_->CompactRange(default_compact_range_options_, handles_[idx], &start_key, &stop_key);
404+
if (!compact_result.ok()) {
405+
LOG(WARNING) << handles_[idx]->GetName()
406+
<< " force CompactRange failed: " << compact_result.ToString()
407+
<< " file=" << file_path;
408+
}
404409
if (--max_files_to_compact == 0) {
405410
break;
406411
}

0 commit comments

Comments
 (0)