-
Notifications
You must be signed in to change notification settings - Fork 2
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
Consider multi-writer transactions? #5
Comments
However, there might be a reasonable path to adding multi-writer transactions (w/o major code changes) by using page-level conflict detection (and/or locking). |
Wait, that first paragraph is not really right... It should be possible to have each concurrent write txn operate on mutable (COW) versions of the database (thus no merging machinery required). Then at commit time the write txn either replaces the database (if there was nothing commited in between) or replays the mutations if there aren't conflicts (there's already a WriteBatch component capturing those). The page-level conflict resolution I mentioned is a variation of that. In that case, instead of replaying the mutations, it would just create a new MVCC snapshot with the updated pages. So pros and cons. |
Ongoing work in #6 |
Having just implemented it in
fjall
, it's really not that bad in terms of added complexity.Of course it depends on each database's snapshotting implementation and garbage collection, but I suspect it wouldn't be too hard to add in Canopy.
Most of the new code is in
src/tx/oracle.rs
andsrc/tx/conflict_manager.rs
, roughly 300 lines of code.It could be feature-flagged due to the added conflict error when committing.
The text was updated successfully, but these errors were encountered: