Repository navigation
[#358] TransactionAbandonedTest: read and write in the abandoned transaction - #366
Merged
vharseko merged 1 commit intoOct 18, 2026
Conversation
…n the abandoned transaction runAndCleanup() passes doRead and doWrite to TxnAbandoner, so readOnly and readAndWrite no longer run the noReadsOrWrites scenario, and checks the raw key count while the abandoned transaction is still open. readAndWrite prunes the rolled back transaction with JournalManager.pruneObsoleteTransactions() instead of running the CleanupManager queue, which never holds it, and then checks that only the committed keys remain. Fixes OpenIdentityPlatform#358
maximthomas
approved these changes
Oct 18, 2026
maximthomas
left a comment
Contributor
There was a problem hiding this comment.
praise: The flags now reach the abandoned transaction, and the assertions finally depend on what cleanup() does.
runAndCleanup()passesdoRead/doWritetoTxnAbandoner(TransactionAbandonedTest.java:110); with that, deleting_persistit.cleanup()turnsreadAndWritered (Raw traversed after abandoned expected:<10> but was:<20>).- The raw count before
cleanup()(:112-113) is taken while the transaction is still open, so it cannot depend on prune timing. pruneObsoleteTransactions(true)(:136) replaces aCleanupManagerloop that never ran, and the class stayed green 50/50 on JDK 11 and on all 9 CI rows.
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
TransactionAbandonedTest.runAndCleanup(name, doRead, doWrite)ignored its flags and always startednew TxnAbandoner(_persistit, false, false). SoreadOnlyandreadAndWriteran thenoReadsOrWritesscenario, and their assertions held whateverPersistit.cleanup()did with the abandoned transaction.With the flags passed through,
readAndWritefails withRaw traversed after abandoned expected:<10> but was:<20>. A rolled back transaction is pruned byJournalManager.pruneObsoleteTransactions(), which replays it withProactiveRollbackListener, not through theCleanupManagerqueue that the test ran.CleanupManager.poll()calls that method at most once every two seconds, and the test reaches the raw scan well before that.Change
runAndCleanup()passesdoReadanddoWritetoTxnAbandoner.cleanup(), while the abandoned transaction is still open,runAndCleanup()checks the raw key count:2 * KEY_RANGEwhen the transaction wrote,KEY_RANGEotherwise. Nothing can prune the versions of a transaction that has not ended, so the check does not depend on when the product prunes, and it fails if the flags stop reaching the abandoned transaction.readAndWriteprunes withpruneObsoleteTransactions(true)before the raw scan. TheCleanupManagerloop is removed: its queue is empty at that point (Buffer.enqueuePruningActionhas no caller), so the loop never ran.Testing (JDK 11, macOS)
TransactionAbandonedTest: all 3 tests pass, 15 consecutive runs green.false, false):Raw traversed before cleanup expected:<20> but was:<10>.pruneObsoleteTransactions(true)call:Raw traversed after abandoned expected:<10> but was:<20>.Fixes #358