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] Phase-2 commit failure uses reset() instead of rollback(), leaving dangling RIDs on user documents #4940
Location:TransactionContext.java:807-812 (commit2ndPhase finally calls reset()) vs rollback():247-295.
On any commit2ndPhase failure the finally calls reset(), which releases locks but skips two things rollback() does: reloading records in modifiedRecordsCache, and resetting the identity of newRecords (the #4562 fix). User-held MutableDocuments created in the failed tx keep an optimistically-assigned RID pointing at a record that was never persisted; re-saving them in the retry treats them as updates of a missing record. The phase-1 failure path correctly uses rollback().
Fix: in the finally, call rollback() (or its record-restoration portion) when !committed.
Filed from an internal engine deep-audit (2026-07). Traced to source; verify against current main before fixing and add a regression test.
Fixed in #5061 (merged). commit2ndPhase's failure handling now distinguishes durability regimes instead of calling reset() unconditionally: a failure BEFORE the WAL append rolls back user-held record state exactly like a phase-1 failure (modified records reloaded, created-record identities reset to provisional per #4562, so a retry re-inserts instead of updating a never-persisted RID); a failure AFTER a real append keeps reset() - the transaction is durable, recovery replays it, and the RIDs stay valid - composed with #5053's recovery fence in the same branch. The useWAL=false path always rolls back (nothing durable, nothing to replay). Hardened through three review rounds: the degraded path (rollback itself failing at the dictionary reload) preserves the primary exception AND still resets created-record identities. Red-first verified ('expected: null but was: #1:0' on unfixed code).
Activity
review(#4940): only a real WAL append suppresses the phase-2 failure …
Merge main (#5053) into fix/4940-4959: compose rollback-vs-fence sema…
review(#5061, round 2): #4940 survives the degraded rollback path; du…
Merge pull request #5061 from ArcadeData/fix/4940-4959-tx-commit-clea…
lvca commentedon Jul 7, 2026
Fixed in #5061 (merged). commit2ndPhase's failure handling now distinguishes durability regimes instead of calling reset() unconditionally: a failure BEFORE the WAL append rolls back user-held record state exactly like a phase-1 failure (modified records reloaded, created-record identities reset to provisional per #4562, so a retry re-inserts instead of updating a never-persisted RID); a failure AFTER a real append keeps reset() - the transaction is durable, recovery replays it, and the RIDs stay valid - composed with #5053's recovery fence in the same branch. The useWAL=false path always rolls back (nothing durable, nothing to replay). Hardened through three review rounds: the degraded path (rollback itself failing at the dictionary reload) preserves the primary exception AND still resets created-record identities. Red-first verified ('expected: null but was: #1:0' on unfixed code).
review(#5075): single-transaction-scoped flag; engine branch genuinel…
fix(ArcadeData#4940,ArcadeData#4959): phase-2 pre-WAL failure rolls b…
fix(ArcadeData#5064): distinct contract for post-quorum local commit …
fix(#6120): fold the index entries on RESTORE DOCUMENT/VERTEX/EDGE (#…
fix(#4940,#4959): phase-2 pre-WAL failure rolls back record state; tx…
review(#4940): only a real WAL append suppresses the phase-2 failure …
review(#5061, round 2): #4940 survives the degraded rollback path; du…
fix(#5064): distinct contract for post-quorum local commit failure
review(#5075): single-transaction-scoped flag; engine branch genuinel…