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

db: double arena memtables #2413

Open
jbowens opened this issue Mar 23, 2023 · 0 comments
Open

db: double arena memtables #2413

jbowens opened this issue Mar 23, 2023 · 0 comments

Comments

@jbowens
Copy link
Collaborator

jbowens commented Mar 23, 2023

Currently a memtable is always backed by a single arena, sized according to the current MemTableSize. With flushable ingests, Options.FlushDelayDeleteRange and Options.FlushDelayRangeKey we can rotate memtables before using all of the arena's allocated memory. In Cockroach, we set a MemTableStopLimit of 4 to avoid allocating more than 256 MB for memtables. Together, these can produce memtable stalls despite low usage of memtable memory.

When a rotated memtable's arena is sufficiently under-utilized, we could instead use the remainder for the next memtable in addition to a new arena. If we additionally add a byte-limiting variant of MemTableStopLimit we can allow accumulation of more memtables without stalling. I think we would still want to keep MemTableStopLimit to prevent accumulating an excessive count of flushables that must be merged at read time.

There are complications that would need to be worked out, because nodes within the arenaskl skiplist use relative offsets within the arena to serve as pointers. I think we could reserve a bit for denoting which arena a pointer refers to.

This may not be worth doing if memtable stalls are infrequent, even with flushable ingests.

Relates to #2388 and #2376.

Jira issue: PEBBLE-200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Backlog
Development

No branches or pull requests

1 participant