| 632 | } |
| 633 | |
| 634 | Status DBImpl::TEST_CompactMemTable() { |
| 635 | // nullptr batch means just wait for earlier writes to be done |
| 636 | Status s = Write(WriteOptions(), nullptr); |
| 637 | if (s.ok()) { |
| 638 | // Wait until the compaction completes |
| 639 | MutexLock l(&mutex_); |
| 640 | while (imm_ != nullptr && bg_error_.ok()) { |
| 641 | background_work_finished_signal_.Wait(); |
| 642 | } |
| 643 | if (imm_ != nullptr) { |
| 644 | s = bg_error_; |
| 645 | } |
| 646 | } |
| 647 | return s; |
| 648 | } |
| 649 | |
| 650 | void DBImpl::RecordBackgroundError(const Status& s) { |
| 651 | mutex_.AssertHeld(); |