Repository navigation
fix: track size_of reads in optimistic transactions - #346
marvin-j97 merged 1 commit into
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Record and test size-query reads src/tx/optimistic/write_tx.rs |
size_of marks the queried key as read. Tests cover write skew, deletion conflicts, pending writes, and unrelated writes. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: marvin-j97
Merge Risk: 
Minimal · up to 43e4f
-
Size reads now participate in conflict detection. No merge-blocking issue is established.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks for the review! I investigated the Windows failure in This appears to be a pre-existing intermittent failure. Could you rerun the failed/cancelled Windows jobs when convenient? |
|
For some reason I've seen Windows CI failing multiple times, always with 140; I'm not sure why... |
Readable::size_ofon an optimistic write transaction reads a snapshot without registering the key in the read set. Two transactions can each read the other key's size, write their own key, and both commit, admitting write skew. Reads returningNonealso carry an existence dependency.Register successful
size_ofreads with the existing conflict manager, matchinggetandcontains_key. Keep the snapshot/overlay lookup so values are not loaded just to measure their length.Add deterministic tests for write skew with existing, empty and missing values, concurrent deletion, rejected writes remaining unpublished, and unrelated keys/keyspaces still committing (including read-your-own-write).
The tests fail at the expected conflict assertions before the fix (2 failed, 1 control passed) and all pass afterward. No public API, dependency or disk-format changes. Affected transactions now return the existing
Conflictresult and must be retried.Validation on Windows:
cargo fmt --all -- --check,cargo clippy,cargo test --features lz4 --all-targets(130 passed, 1 ignored),cargo test --doc(86 passed).cargo build --all-featuresalso passes.cargo +1.90.0 test --lib(75 passed, 1 ignored),cargo +1.90.0 build --all-features.cargo test --all-features --lib tx_ssi_size_of(3 passed); basic example printsOK.Additional checks expose existing upstream failures, reproduced on unchanged main with the same Cargo.lock:
cargo clippy --all-targetsreports 25 errors in existing tests;cargo test --no-default-features --lib tx_ssi_size_ofcannot compilesrc/keyspace/options.rs:709(missingSome). The no-default library builds. Linux/macOS and nextest were not run locally.No directly matching issue found. Related #299 adds explicit untracked reads; this fixes the default tracked transaction without adding that API.
Summary by CodeRabbit