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

Add support to Roots for acquiring multiple trees for read with the same state (MVCC) #32

Open
ecton opened this issue Jan 30, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ecton
Copy link
Member

ecton commented Jan 30, 2022

It occurred to me that one aspect of locking that many databases support is a way to lock multiple tables for read to ensure that none of them change while your series of queries execute. Currently, BonsaiDb has no way to guarantee that two view queries or two collection Get calls both happen on the same transaction state, and Nebari technically can support it but doesn't provide a mechanism to succeed without loops currently.

This would be a new API very similar to the transaction API, except the trees returned would be normal trees. While the tree states are being acquired, each touched tree must keep its read handle locked to prevent any writer from publishing. Once all states have been acquired, the writers can be unblocked. All queries to the tree should use the cached state not the tree's current state.

If a compaction occurs, the operation must be re-performed.

@ecton ecton added the enhancement New feature or request label Jan 30, 2022
@ecton ecton moved this to Todo in Beta Roadmap Jan 30, 2022
@ecton ecton changed the title Add support to Roots for acquiring multiple trees for read with the same state Add support to Roots for acquiring multiple trees for read with the same state (MVCC) Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant