Skip to content
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

IsEmpty() checks were missing before some SwitchMemtable() invocations #12230

Conversation

pranavshenoy
Copy link

@pranavshenoy pranavshenoy commented Jan 12, 2024

Fixes #12179

There was one instance where the IsEmpty() check was missing:

status = SwitchMemtable(cfd, write_context);

Having one check inside SwitchMemTable() will ensure there won't be misses in the future.

Copy link
Contributor

@ajkr ajkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A relevant test "DBTest.DeletingOldWalAfterDrop" fails. It is likely that empty memtables can pin old WALs, which we would need to somehow fix first.

By the way, empty memtable is supposed to be cheap (minimal memory usage), at least for inline skiplist. If it's consuming meaningful memory, we might be doing something wrong there.

@rockeet
Copy link
Contributor

rockeet commented Jan 29, 2024

This PR did not fix the issue, we applied this PR to our branch, the issue still exists:
image

The gray text is empty MemTable.

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.

Many empty memtables are created during MyRocks create index
4 participants