You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[tx] Files can join a transaction's page set after the commit lock set is computed #4937
Severity: HIGH (enabler for aborted-tx WAL replay)
Location:TransactionContext.java:644-674 (lock set computed at :652, updateRecordNoLock at :665), serializer/BinarySerializer.java:975,1166 (EXTERNAL property values written to the paired external bucket during phase-1 serialization), index/lsm/LSMTreeIndex.java:515 (during phase 1 status==COMMIT_1ST_PHASE, so indexer.updateDocument writes directly into index pages, incl. indexes created mid-tx that were absent from indexChanges at lock time), TransactionIndexContext.java:248-282 (addFilesToLock omits LSMVectorIndexs companion graph file).
Pages of these late-joining files pass phase-1 checkPageVersionwithout their file lock held, making the aborted-tx WAL-replay interleaving reachable and producing surprise phase-2 CMEs. Reachable with (a) EXTERNAL properties updated via the deferred path in two concurrent txns, (b) vector-index graph-file writes.
Also note deferred updates apply index mutations twice (directly at :665-673, then via putReplay at :689) - benign for lookups but doubles LSM garbage/compaction.
Fix: after updateRecordNoLock + indexChanges.commit(), assert every file in modifiedPages/newPages is locked; if not, release, re-lock the union, and re-validate (bounded retry). Add the vector graph file id in addFilesToLock.
Filed from an internal engine deep-audit (2026-07). Traced to source; verify against current main before fixing and add a regression test.
Multi-file indexes now contribute ALL their component files to the commit lock set: addFilesToLock consumes getFileIds() (plural) and LSMVectorIndex.getFileIds() includes the companion graph file (it returned only the mutable file). This also fixed the latent add(-1) for composite TypeIndex ids.
A generic phase-1 safety net verifies - AFTER all page-set mutation (updateRecordNoLock, indexChanges.commit) - that every file in modifiedPages/newPages is locked, releasing and re-acquiring the UNION in lock order when a late joiner is found (allocation-free fast path on the common no-late-joiner case). In explicit-lock mode an uncovered late joiner (EXTERNAL-property paired bucket, index created inside the transaction) is surfaced as the 'not all the modified resources were locked' contract violation instead of silently expanding the user's lock set - red-first verified via the EXTERNAL-property path.
This closed the enabler for #4936's aborted-transaction WAL replay.
Activity
Merge pull request #5053 from ArcadeData/fix/4936-4937-commit-point-o…
lvca commentedon Jul 7, 2026
Fixed in #5053 (merged), two layers:
This closed the enabler for #4936's aborted-transaction WAL replay.
fix(ArcadeData#4936,ArcadeData#4937): the WAL append is the commit's …
fix(#4936,#4937): the WAL append is the commit's point of no return
fix(ArcadeData#6527): make LSMVectorIndex.graphFile volatile for cros…
fix(ArcadeData#7361,ArcadeData#7362,ArcadeData#7363): a graph persist…
fix(#11526): a commit no longer releases its locks after the unique-k…