Per-object transaction commit validation and publication (MVCC write sets) #40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/tx-write-sets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Per-object transaction commit (MVCC write sets)
What
Replaces whole-database snapshot commit (
database-commit-snapshot!, kept as the conservative fallback) withdatabase-commit-objects!: a transaction's commit validates only the catalog objects it wrote against committed object revisions, then publishes exactly those objects from its working snapshot into the shared base.TransactionContext Error: Conflict on commit.table:), views (view:), indexes (index:), sequences (sequence:), schemas (schema:create/drop). Unknown keys (e.g.database:*) fall back to the conservative whole-database check + swap.remove-indexes-for-table!), mirroring the catalog paths.Known limitation
Each transaction fork consumes
nextvalfrom its own snapshot of the sequence state, so concurrent transactions may draw the same value; commit merging guarantees only that the furthest-advanced value survives (test documents this: two concurrent first draws → next value is 2, not 3).Tests
test/unit/concurrency.ssadditions: disjoint-table commits, same-table conflict preserved, disjoint DDL (table vs view), DML+DDL commute, sequence gap merge, drop-vs-insert commute. Existing interrupt/snapshot/GC/history tests unchanged and green.Verification
make buildmake unitx3 (concurrency suite green every run)make verify(contracts-check, diff, bench, sqllogic, sqllogic-upstream, sqllogic-events, sqllogic-events-failure-check, concurrency-stress, native-race-check, check-docs, binary build) — all greenmake security,sh test/cli/compat.sh dist/jduckdb,git diff --check— cleanVersion: 0.17.15
4cc04a575af48bfff08aCI status note (2026-09-18 ~12:35 UTC-4):
required-cifailures on this PR (runs 208/210/212) are infrastructure, not the change:make verifyon freebsd-amd64 take 3-5 minutes).workflow_dispatchof the same ci.yaml on main (run 214, commitb392ffe) fails identically in 3s — that exact commit passed at 10:42 (run 207, 3.5 min).4cc04a5passed required-ci in full (run 141).The rebased
f48bfffis fully green locally:make build,make unitx4,make verify,make security, compat smoke,git diff --check. Will retrigger and merge once the runner recovers.