Repository navigation
Conversation
…stSingleNodeWithOpenPipelineCanGotoMaintenance waitForDnToReachPersistedOpState polls the DatanodeDetails instance it is given. When a restarted datanode re-registers with a different port set, SCMNodeManager#register replaces the stored DatanodeInfo, so a reference captured before the restart never sees the persisted state change and the wait times out. Look up the node from NodeManager after the restart before waiting for the persisted state, in both testSingleNodeWithOpenPipelineCanGotoMaintenance and testNodeWithOpenPipelineCanBeDecommissionedAndRecommissioned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
smengcl
marked this pull request as ready for review
October 20, 2026 23:36
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.
Generated-by: Claude Code (Opus 5.5)
What changes were proposed in this pull request?
testSingleNodeWithOpenPipelineCanGotoMaintenanceintermittently times out in its lastwaitForDnToReachPersistedOpState(dn, IN_SERVICE).That helper polls
getPersistedOpState()on theDatanodeDetailsinstance passed in. The test passesdn, captured fromnm.getNode(dnID)before the datanode is restarted. When a restarted datanode re-registers with a different port set,SCMNodeManager#registerreplaces the storedDatanodeInfo(theportsChangedpath from HDDS-12991). In the failing run the HTTP port was missing from the initial registration and present after the restart, so SCM swapped the object, updated the persisted state on the new one (IN_MAINTENANCE -> IN_SERVICEin the log), and the test kept polling the stalednuntil it timed out.The fix looks up the node from
NodeManagerafter the restart before waiting for the persisted state:newDnintestSingleNodeWithOpenPipelineCanGotoMaintenance(the neighbouring waits already use it), andnm.getNode(dnID)intestNodeWithOpenPipelineCanBeDecommissionedAndRecommissioned, which had the same stale reference.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17190
How was this patch tested?
The fix is deterministic:
restartHddsDatanode(..., true)returns only after the datanode is healthy again in SCM, so the re-registration (and any replacement of the stored node) has already happened, andnm.getNodereturns the current instance.mvn -pl :ozone-integration-test -am test -Dtest='TestDecommissionAndMaintenance#testSingleNodeWithOpenPipelineCanGotoMaintenance+testNodeWithOpenPipelineCanBeDecommissionedAndRecommissioned': 2 tests, 0 failures.ozone-integration-test.