smengcl opened a new pull request, #11643: URL: https://github.com/apache/ozone/pull/11643
Generated-by: Claude Code (Opus 5.5) ## What changes were proposed in this pull request? `testSingleNodeWithOpenPipelineCanGotoMaintenance` intermittently times out in its last `waitForDnToReachPersistedOpState(dn, IN_SERVICE)`. That helper polls `getPersistedOpState()` on the `DatanodeDetails` instance passed in. The test passes `dn`, captured from `nm.getNode(dnID)` before the datanode is restarted. When a restarted datanode re-registers with a different port set, `SCMNodeManager#register` replaces the stored `DatanodeInfo` (the `portsChanged` path 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_SERVICE` in the log), and the test kept polling the stale `dn` until it timed out. The fix looks up the node from `NodeManager` after the restart before waiting for the persisted state: `newDn` in `testSingleNodeWithOpenPipelineCanGotoMaintenance` (the neighbouring waits already use it), and `nm.getNode(dnID)` in `testNodeWithOpenPipelineCanBeDecommissionedAndRecommissioned`, 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, and `nm.getNode` returns the current instance. - `mvn -pl :ozone-integration-test -am test -Dtest='TestDecommissionAndMaintenance#testSingleNodeWithOpenPipelineCanGotoMaintenance+testNodeWithOpenPipelineCanBeDecommissionedAndRecommissioned'`: 2 tests, 0 failures. - Checkstyle passes for `ozone-integration-test`. - 10x10 [flaky-test-check](https://github.com/smengcl/hadoop-ozone/actions/runs/39486679202) of the whole class on this branch: in progress -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
