Skip to content

[#309] Add MVCC diagnostics to TreeTransactionalLifetimeTest.createRemoveByStep - #310

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:persistit/diag-create-remove-by-step-309
Sep 25, 2026
Merged

vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:persistit/diag-create-remove-by-step-309

Conversation

@vharseko

Copy link
Copy Markdown
Member

Refs #309. This PR does not close the issue: it adds diagnostics only.

Problem

TreeTransactionalLifetimeTest.createRemoveByStep still fails intermittently on CI (ubuntu-latest / JDK 21):

createRemoveByStep:182 -> createRemoveByStepHelper:215
expected:<0[],1:,2:a=step2,3,4:b=...> but was:<0[:],1:,2:a=step2,3,4:b=...>

Line 215 is the assert that runs inside the still-open ttlt5cr transaction, before its crash. A tree created at step 1 is reported visible at step 0 of the same transaction, while steps 1-4 are all correct (including "not visible" at step 3, after removeTree()). This is the same signature as #260 / #264. #266 (MVCC settle at the end of Persistit.initialize()) is already on master, so that explanation is incomplete. ttlt5cr is also a fresh tree name that nothing from the earlier crashed cases refers to.

Reading the code did not reveal the mechanism, and reproduction failed:

  • macOS / JDK 21: in-JVM stress loop, 1000 cases, 0 failures;
  • Linux / JDK 21 containers, 3 in parallel for CPU contention, a fresh JVM per run: 126 runs, 0 failures.

Change

Test-only. The assert is unchanged. On an expected1 mismatch the failure message now also carries:

  • the transaction status and start timestamp;
  • the tree's TimelyResource version chain after each step and at the failure. It is read reflectively, because Tree#toString() calls version(), which can add a version and change the state being reported;
  • the Tree instance getTree() returns at each step (same object or a different one);
  • the active transaction cache floor/ceiling and the non-empty TransactionIndex buckets.

The next CI occurrence will then show which entry makes the tree visible at step 0, which is what a product fix needs.

Verification

  • TreeTransactionalLifetimeTest: 5/5 green (JDK 21).
  • The diagnostic path was exercised by temporarily changing ttlt5cr's expected1. The message showed the expected chain (ts=…#01, #03 deleted, #04) and the per-step getTree results. The change was reverted afterwards.

…ifetimeTest.createRemoveByStep

The pre-crash assert in createRemoveByStepHelper intermittently reports a
tree created at step 1 as visible at step 0 (CI only, not reproducible
locally or in Linux/JDK 21 containers). Keep the assert unchanged, but on
mismatch include the tree's TimelyResource chain per step, the Tree
instance returned by getTree() per step, the active transaction cache
bounds and the TransactionIndex buckets, so the next CI occurrence shows
which version makes the tree visible.

Refs OpenIdentityPlatform#309
@vharseko vharseko added the tests Test code changes label Sep 23, 2026
@vharseko
vharseko merged commit 66da47c into OpenIdentityPlatform:master Sep 25, 2026
14 checks passed
@vharseko
vharseko deleted the persistit/diag-create-remove-by-step-309 branch September 25, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant