rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

MemTableList::Add: `MarkImmutable()` before `current_->Add()`

Open rockeet opened this issue 6 months ago • 0 comments

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.

rockeet avatar Jun 11 '25 02:06 rockeet