Skip to content

feat(txn): serializable snapshot isolation for transaction blocks - #442

Merged
farhan-syah merged 47 commits into
mainfrom
fix/txn-snapshot-isolation
Nov 2, 2026
Merged

farhan-syah merged 47 commits into
mainfrom
fix/txn-snapshot-isolation

Conversation

@farhan-syah

@farhan-syah farhan-syah commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Why

What changed

  • Transactions are serializable. They read at a point pinned by the first statement.
  • COMMIT checks the read and write sets on every replica. A conflict fails with 40001.
  • Engines keep old row versions until no open transaction needs them.
  • A transaction open past txn_snapshot_max_age_secs fails with 40001.
  • A write that cannot wait for COMMIT fails inside a transaction with 25001.
  • Every format version is 1. Old data does not open, and all compat code is removed.
  • Quarantine is per tenant and per FTS field, for the process lifetime. [quarantine_storage] is removed.
  • Also fixed: KV TTL replication, UPDATE ... FROM / MERGE NULLs, INSERT ... SELECT rollback, LAST_VALUE cache, detect_i64_codec panic, Calvin leader restart, restore of old versions.

Lite breaks: new plan-op fields and MetaOp arms, TileEntry.placement, required sync fields (checksum 0 refused), strict ErrorDetails / TextFields decoding, RecordType::GraphNodeCascade removed.

How to check

  • Wire tests txn_serializable_conflicts, txn_snapshot_reads, version_cleanup_horizon.
  • Full suite passes with --retries 0.

Closes #430
Closes #370

@farhan-syah farhan-syah added the run-ci Opt this PR into the full test suite; re-add to force a re-run label Nov 2, 2026
Remove the ShardVersion and WriteVersion types. Columnar WAL records,
sync wire types, and shared identifiers no longer carry per-write
version stamps. Transactions read a snapshot cut instead.
Record type 65 names no record type. Readers and writers drop the
foreign version header fields.
Add version chains, cuts, and per-segment version tables. Mutations
record history, install rows at a version, and purge history. Readers
select blocks by cut. Row materialization returns every stored version.
Add a node filter that hides live nodes written after a cut and admits
soft-deleted nodes ended after it. Add versioned search, export, and
insert operations to the collection.
Remove the home-version meta plan. Add restore key and version purge
meta plans. Read and write plans carry snapshot cuts.
…tions

Nodes exchange their oldest held snapshot on the health ping to derive
the cleanup horizon. Raft groups carry ordinal floors and a sequencer
cut floor. The Calvin sequencer forwards entries and wakes catch-up
waiters. Sequencer types carry an incarnation.
@farhan-syah
farhan-syah force-pushed the fix/txn-snapshot-isolation branch from 3aa68e9 to 3dd4d31 Compare November 2, 2026 07:53
The test seeds a stored user with an empty password to check that CredentialStore::open refuses empty derived credentials. No production credential comes from it.
…g propose test

The message now states the expected outcome in plain words.
The test overwrites 100 rows a few times instead of one row hundreds of times. The writes take few statements, so they finish inside the history window on a slow runner before any pass trims them.
@farhan-syah
farhan-syah merged commit f8c478f into main Nov 2, 2026
16 checks passed
@farhan-syah
farhan-syah deleted the fix/txn-snapshot-isolation branch November 2, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci Opt this PR into the full test suite; re-add to force a re-run

Projects

None yet

1 participant