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

Use ReadTier::kMemtableTier in read-before-write for max_successive_merges #8516

Open
duarten opened this issue Jul 12, 2021 · 3 comments
Open

Comments

@duarten
Copy link
Contributor

duarten commented Jul 12, 2021

Currently, max_successive_merges performs a read-before-write from disk to replace the current merge value in the memtable with a put. That read is blocking, which stalls the current thread. It would be better if max_successive_merges performed the read only within the memtable tier, replacing the current set of merge operands with the result of partially merging them. This likely requires introducing a new ValueType, and maybe a new toggle.

@ajkr
Copy link
Contributor

ajkr commented Jul 14, 2021

cc @benclay - would this be of use to your team to avoid the occasional latency due to read I/O in the write path while still enabling max_successive_merges? Sorry if there was another resolution; I can't remember now.

Somehow FB doesn't have much in the way of merge-heavy latency-sensitive use cases, so this feature would be hard to prioritize. But it would be a great feature to have.

I think the new ValueType could be memtable only and not persisted anywhere. The new ValueType would indicate the value contains the merged result for the memtable up to that point. Then only memtable reads need to know how to interpret it and there's no compatibility concerns.

@benclay
Copy link
Contributor

benclay commented Jul 14, 2021 via email

@ajkr
Copy link
Contributor

ajkr commented Feb 21, 2024

We finally ran into this. #12365 should improve things although the solution discussed in this issue would be even better.

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

No branches or pull requests

3 participants