You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: