KV store: Implement transaction rollback#241
Open
nrc wants to merge 2 commits into
Open
Conversation
4eb2c2f to
b1e2b2b
Compare
This means that transactions are atomic, even if a transaction is abandoned. Signed-off-by: Nick Cameron <nrc@ncameron.org>
npry
reviewed
Jun 17, 2026
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Contributor
Author
|
@npry thanks for the review! All comments addressed in the separate commit (and/or replies) |
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 means that transactions are atomic, even if a transaction is abandoned.
Closes #216
To review, I would start with the new docs in lib.rs, then read storage.rs (where most of the changes are). The rest should be fairly straightforward after that.
This does end up making the API a bit more restrictive, that is because to enable transaction rollback, we need to be able to clone values, and we can no longer move out of the store, so
removeandinsertcan't return the removed old values. (technically we could with the raw API, but because code is shared, that is not possible. If we want to implement that for performance or ergonomics, we can). Work-around is to usegetand clone.LLM declaration. I used Claude to generate tests and have reviewed the generated code.