Stabilize flaky TreeTransactionalLifetimeTest.createRemoveByStep#260
Closed
vharseko wants to merge 2 commits into
Closed
Stabilize flaky TreeTransactionalLifetimeTest.createRemoveByStep#260vharseko wants to merge 2 commits into
vharseko wants to merge 2 commits into
Conversation
The crash/restart branches of createRemoveByStepHelper reopen Persistit and
return without waiting for recovery and timely-resource pruning to settle.
Those run asynchronously after initialize(), so the next helper iteration can
begin a transaction against not-yet-settled state, and residual tree-version
state from the previous iteration's crash/restart leaks into the new
transaction's step-based MVCC visibility -- a tree created at step 1 becomes
visible at step 0. That produced an intermittent ComparisonFailure
("expected:<0[]...> but was:<0[:]...>") on CI (ubuntu-latest JDK 21); it does
not reproduce on macOS.
Quiesce the MVCC state after the restart by updating the active-transaction
cache and pruning timely resources -- the same idiom the sibling tests in this
class already use before asserting.
maximthomas
approved these changes
Jul 10, 2026
… the ATC updater and CleanupManager pruning Per review on OpenIdentityPlatform#257: initialize() applies recovered transactions inline, so blaming asynchronous recovery was wrong and would send a maintainer hunting a race that does not exist. The asynchronous actors that make the settle calls necessary are the TransactionIndex active-transaction-cache updater thread and the CleanupManager's timer-driven pruneTimelyResources(). Comment-only change.
This was referenced Jul 10, 2026
Member
Author
|
Closing in favor of #266: it adds the same two calls ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TreeTransactionalLifetimeTest.createRemoveByStepis flaky. Itscrash/restartsub-cases reopen Persistit and return without waiting for recovery and timely-resource pruning to settle:Recovery and the pruning of timely tree resources run asynchronously after
initialize(). So the next helper iteration can begin a transaction against not-yet-settled state, and residual tree-version state from the previous iteration's crash/restart leaks into the new transaction's step-based MVCC visibility — a tree created at step 1 becomes visible at step 0:Observed on
build-maven (ubuntu-latest, 21); it does not reproduce on macOS (40 local runs green).Fix
Quiesce the MVCC state after the restart by updating the active-transaction cache and pruning timely resources — the same idiom the sibling tests in this class already use before asserting (
updateActiveTransactionCache()+pruneTimelyResources()). The change adds nothing but a settle point; it weakens no assertion (theexpected2check after restart is unaffected — pruning removes only obsolete versions).Not caused by this PR's parent change
Unrelated to the PR it was blocking (#257, which fixes
Bug1017957Test.induceCorruptionByStress): that PR touches onlyBug1017957Test.java, a different test.Verification
createRemoveByStep7/7 green; fullTreeTransactionalLifetimeTestclass 5/5.