rocksdb
rocksdb copied to clipboard
MemTableList::Add: `MarkImmutable()` before `current_->Add()`
The semantic of MemTableList::Add is add the immutable memtable, so current_->Add() should be called after MarkImmutable().
MemTable.MarkImmutable() calls MemTableRep.MarkReadOnly(), which may update memory usage which reported by ApproximateMemoryUsage, thus causing assert fail in MemTableListVersion::UnrefMemTable().
This issue was not reproduced is because rocksdb builtin MemTableRep does not update ApproximateMemoryUsage in MarkImmutable, but our custom MemTableRep does, yield the fails.