feat: implement SSI predicate locking#10
Merged
danpasecinic merged 13 commits intodevelopmentfrom Jan 16, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces Serializable Snapshot Isolation (SSI) to the MVCC engine, enabling true serializable transactions and improving transaction isolation guarantees. It adds a new SSI manager, updates transaction logic to support various serializable modes, and introduces comprehensive error handling and testing for serializability conflicts.
Serializable Snapshot Isolation (SSI) Integration:
Added the
SSIManagerand related types to the MVCC engine (MvccEngine), with new logic for tracking reads and writes, validating serializability at commit, and handling aborts and cleanup. (crates/crabstash-txn/src/mvcc.rs,crates/crabstash-lock/src/lib.rs) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Extended the
IsolationLevelenum to supportSerializableReadOnlyandSerializableDeferrablemodes, with helper methods for checking isolation properties. (crates/crabstash-txn/src/transaction.rs)Error Handling Improvements:
WriteSkew,PhantomRead,SerializableConflict) and mapped SSI conflict errors to these variants. (crates/crabstash-common/src/error.rs,crates/crabstash-txn/src/mvcc.rs) [1] [2] [3]Testing and Validation:
crates/crabstash-txn/src/mvcc.rs)Dependency and API Updates:
rapidhashas a dependency for workspace crates, likely used by the SSI manager. (Cargo.toml,crates/crabstash-lock/Cargo.toml) [1] [2]Dbtype. (crates/crabstash/src/lib.rs) [1] [2]Development Tooling:
tempfileas a dev-dependency to facilitate testing. (crates/crabstash-txn/Cargo.toml)