|
@ -924,6 +924,10 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) { |
|
|
bool has_current_user_key = false; |
|
|
bool has_current_user_key = false; |
|
|
SequenceNumber last_sequence_for_key = kMaxSequenceNumber; |
|
|
SequenceNumber last_sequence_for_key = kMaxSequenceNumber; |
|
|
while (input->Valid() && !shutting_down_.load(std::memory_order_acquire)) { |
|
|
while (input->Valid() && !shutting_down_.load(std::memory_order_acquire)) { |
|
|
|
|
|
auto x=input->value(); |
|
|
|
|
|
uint64_t ttl=*(uint64_t*)(x.data()+x.size()-sizeof(uint64_t)); |
|
|
|
|
|
time_t now = time(nullptr); |
|
|
|
|
|
if(ttl < static_cast<uint64_t>(now))return; |
|
|
// Prioritize immutable compaction work
|
|
|
// Prioritize immutable compaction work
|
|
|
if (has_imm_.load(std::memory_order_relaxed)) { |
|
|
if (has_imm_.load(std::memory_order_relaxed)) { |
|
|
const uint64_t imm_start = env_->NowMicros(); |
|
|
const uint64_t imm_start = env_->NowMicros(); |
|
|