feat(txn)!: DB_TXN_SNAPSHOT is now serializable snapshot isolation (SSI); remove DB_TXN_SNAPSHOT_SAFE - #133
Merged
Merged
Conversation
BREAKING (ABI): DB_TXN_SNAPSHOT now provides serializable snapshot isolation (SSI) -- snapshot isolation plus Cahill serializable conflict detection -- and the separate DB_TXN_SNAPSHOT_SAFE flag (0x800) is REMOVED. There is no longer a plain, non-serializable SI mode via the public API: every snapshot transaction gets SSI and may be aborted with DB_SNAPSHOT_UNSAFE / DB_SNAPSHOT_CONFLICT, and cannot be prepared for two-phase commit. This drops the awkward _SAFE flag name in favor of the natural DB_TXN_SNAPSHOT, at the cost of a deliberate ABI break (the maintainer accepted this). - txn.c: DB_TXN_SNAPSHOT (and the env-wide DB_ENV_TXN_SNAPSHOT) now set both the internal TXN_SNAPSHOT substrate and TXN_SNAPSHOT_SAFE (SSI) states; removed DB_TXN_SNAPSHOT_SAFE from the txn_begin OK_FLAGS mask; prepare() rejection message updated to name DB_TXN_SNAPSHOT. - dist/api_flags + regenerated src/dbinc_auto/api_flags.in + build_windows/db.h: DB_TXN_SNAPSHOT_SAFE definition removed; its 0x800 bit is freed. - db.in: internal TXN_SNAPSHOT comment clarified (substrate, always with SSI). - lang/tcl: -snapshot_safe kept as a compat alias for -snapshot (both now SSI) so existing SSI tests keep working unchanged. The internal TXN_SNAPSHOT_SAFE state and all SSI machinery (SIREAD markers, the lock.c GC, db_meta.c conflict recording) are unchanged. Verified: builds clean; ssi001-009, txn001/003, test001 btree/hash all pass.
Follow the DB_TXN_SNAPSHOT_SAFE removal through the rest of the tree: - docs_src: txnbegin.md merges the two flag entries into one DB_TXN_SNAPSHOT (SSI) description; envset_flags.md, the isolation + transaction-read guides, and program_errorret.md updated; a compatibility note explains the fork's change vs stock Oracle BDB. flag-reconcile.md records the removal. - README.md: the SSI bullet now says DB_TXN_SNAPSHOT is serializable + notes the ABI break. - rfc/0003 (SSI): an Amendment note records the API simplification; INDEX updated. - test/bench/ssi_abort_bench.c: uses DB_TXN_SNAPSHOT (the removed _SAFE flag would not compile); builds clean. TCL -snapshot_safe stays a compat alias (prior commit); the .tcl SSI tests are unchanged and pass. Docs build clean.
Coccinelle convention checksNo new violations. ✅ Resolved since baseline (2) -- update dist/cocci/baseline.txt to lock these in. |
ABI diff vs
|
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.
BREAKING (ABI, deliberate).
DB_TXN_SNAPSHOTnow provides serializable snapshot isolation (SSI) — snapshot isolation + Cahill serializable conflict detection — and the separateDB_TXN_SNAPSHOT_SAFEflag (0x800) is removed. This drops the awkward_SAFEflag name in favor of the naturalDB_TXN_SNAPSHOT, at the cost of an ABI break the maintainer accepted.There is no longer a plain, non-serializable SI mode via the public API: every snapshot transaction gets SSI, may be aborted with
DB_SNAPSHOT_UNSAFE/DB_SNAPSHOT_CONFLICT, and cannot be 2PC-prepared.Engine
txn.c:DB_TXN_SNAPSHOT(and env-wideDB_ENV_TXN_SNAPSHOT) now set both the internalTXN_SNAPSHOTsubstrate andTXN_SNAPSHOT_SAFE(SSI) states; removedDB_TXN_SNAPSHOT_SAFEfrom thetxn_beginOK_FLAGS mask;prepare()message updated.dist/api_flags+ regeneratedapi_flags.in+build_windows/db.h: flag definition removed, 0x800 freed.db.in: internalTXN_SNAPSHOTcomment clarified.lang/tcl:-snapshot_safekept as a compat alias for-snapshot(both now SSI) so existing SSI tests run unchanged.TXN_SNAPSHOT_SAFEstate + all SSI machinery (SIREAD markers, lock.c GC, db_meta.c) are unchanged.Docs / RFC / bench
docs_src:txnbegin.mdmerges the two entries into one SSIDB_TXN_SNAPSHOT; isolation/transaction guides,envset_flags,program_errorret, and the flag-reconcile doc updated with a stock-BDB-vs-fork note.README.md, RFC 0003 (Amendment note),INDEX.mdupdated.test/bench/ssi_abort_bench.cusesDB_TXN_SNAPSHOT(builds clean).Verified
Builds clean;
ssi001–ssi009,txn001/003,test001btree/hash all pass; docs build clean; bench builds.