diff --git a/db/compaction_job.cc b/db/compaction_job.cc index c986b9a80..4754b6be4 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -1041,6 +1041,7 @@ Status CompactionJob::FinishCompactionOutputFile( auto meta = &sub_compact->current_output()->meta; if (s.ok()) { Slice lower_bound_guard, upper_bound_guard; + std::string smallest_user_key; const Slice *lower_bound, *upper_bound; if (sub_compact->outputs.size() == 1) { // For the first output table, include range tombstones before the min key @@ -1050,7 +1051,8 @@ Status CompactionJob::FinishCompactionOutputFile( // For subsequent output tables, only include range tombstones from min // key onwards since the previous file was extended to contain range // tombstones falling before min key. - lower_bound_guard = meta->smallest.user_key(); + smallest_user_key = meta->smallest.user_key().ToString(false /*hex*/); + lower_bound_guard = Slice(smallest_user_key); lower_bound = &lower_bound_guard; } else { lower_bound = nullptr;