As part of the rebase on RocksDB 8.6.7, the following commit:
8c2e91aca - Patch 8.6.6 (#11886)
Fixed a bug. Consequently, the following 2 new unit tests from db_flush_test.cc that were written to test the bug now fail:
DBFlushTest.AbortNonAtomicFlushWhenBGError
DBFlushTest.NonAtomicFlushRollbackPendingFlushes
The reason seems to be that, as part of the fix, a memtable starts flushing twice, causing an assertion in AllocTracker:
db_flush_test: memtable/alloc_tracker.cc:62: void rocksdb::AllocTracker::FreeMemStarted(): Assertion 'state_ == State::kDoneAllocating' failed.
After adding debug prints in alloc_tracker.cc, we may see the following (the pointer on the left is the address of the AllocTracker object):
Handle FreeMemStarted as a no-op when already in state State::kFreeMemStarted
Preferable: Check if it's possible to call FreeMemAborted on the memtable. If it is possible, then the state machine of AllocTracker may stay unmodified.
As part of the rebase on RocksDB 8.6.7, the following commit: 8c2e91aca - Patch 8.6.6 (#11886)
Fixed a bug. Consequently, the following 2 new unit tests from
db_flush_test.cc
that were written to test the bug now fail:DBFlushTest.AbortNonAtomicFlushWhenBGError
DBFlushTest.NonAtomicFlushRollbackPendingFlushes
The reason seems to be that, as part of the fix, a memtable starts flushing twice, causing an assertion in AllocTracker:
db_flush_test: memtable/alloc_tracker.cc:62: void rocksdb::AllocTracker::FreeMemStarted(): Assertion 'state_ == State::kDoneAllocating' failed.
After adding debug prints in alloc_tracker.cc, we may see the following (the pointer on the left is the address of the AllocTracker object):
This needs further investigation. Options: