Wait for the renamed entry before reading the naming conflict monitor - #895
Open
vharseko wants to merge 1 commit into
Open
Conversation
UpdateOperationTest.namingConflicts cleans up after the two-adds-one-DN case by publishing a delete for each entry and then waiting for each DN to go. Both entries were created with the same DN, though - personWithSecondUniqueID is built at user1dn, the DN of personWithUUIDEntry - and the conflicting one has since been renamed to "entryuuid=<uuid> + user1dn". So both waits watch user1dn and both return the moment the first delete is replayed; nothing waits for the second. That second delete is the one with a conflict to solve. Its DN holds no entry any more, so solveNamingConflict(DeleteOperation) finds the renamed one by entryUUID and counts a resolved naming conflict before replaying the delete against the new DN. The next section snapshots that counter with updateMonitorCount() and asserts a delta of 1 for the conflict it raises itself, so a count that arrives late is read as its own: "expected [1] but found [2]", as on JDK 25 in run 32375391745. Wait for the DN the rename gave the entry instead. The count is taken before the replayed delete, so an entry gone from that DN means the count is already in the monitor.
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.
UpdateOperationTest.namingConflictsfails intermittently in CI withseen on JDK 25 in run 32375391745, where the other JDKs of the same run passed.
Why
The clean-up after the two-adds-one-DN case publishes a delete for each entry and then waits for each DN to go:
Both entries were created with the same DN —
personWithSecondUniqueIDis built atuser1dn, the DN ofpersonWithUUIDEntry— and the conflicting one has since been renamed by the test toentryuuid=<user1entrysecondUUID> + user1dn. So both waits watchuser1dnand both return the moment the first delete is replayed. Nothing waits for the second.The second delete is the one with a conflict to solve: its DN holds no entry any more, so
solveNamingConflict(DeleteOperation)finds the renamed entry by entryUUID and counts a resolved naming conflict before replaying the delete against the new DN. The next section snapshots that counter withupdateMonitorCount(baseDN, resolvedMonitorAttr)and asserts a delta of 1 for the conflict it raises itself — so a count that arrives late is read as its own, and the assertion sees 2.Fix
Wait for the DN the rename gave the entry. The count is taken before the replayed delete, so an entry gone from that DN means the count is already in the monitor.
The other clean-up block in the same method waits on a distinct DN per delete and is not affected.
Verification
mvn -pl opendj-server-legacy verify -Pprecommit -Dit.test='UpdateOperationTest#namingConflicts'—Tests run: 1, Failures: 0, Errors: 0.