Pārlūkot izejas kodu

Allow compaction to finish in TEST_CompactRange

Waits for a current transaction to finish in TEST_CompactRange when the
`background_work_finished_signal_` signal may be emitted due to an error. This is a prospective fix for flaky crashes observed in b/351680196#comment5.

PiperOrigin-RevId: 663457574
main
leveldb Team pirms 3 mēnešiem
revīziju iesūtīja Brad Triebwasser
vecāks
revīzija
eb31d19999
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. +5
    -0
      db/db_impl.cc

+ 5
- 0
db/db_impl.cc Parādīt failu

@ -629,6 +629,11 @@ void DBImpl::TEST_CompactRange(int level, const Slice* begin,
background_work_finished_signal_.Wait();
}
}
// Finish current background compaction in the case where
// `background_work_finished_signal_` was signalled due to an error.
while (background_compaction_scheduled_) {
background_work_finished_signal_.Wait();
}
if (manual_compaction_ == &manual) {
// Cancel my manual compaction since we aborted early for some reason.
manual_compaction_ = nullptr;

Notiek ielāde…
Atcelt
Saglabāt