Skip to content

MemTableList::Add: MarkImmutable() before current_->Add() #13682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rockeet
Copy link
Contributor

@rockeet rockeet commented Jun 11, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants