Skip to content

HDDS-17190. Intermittent failure in TestDecommissionAndMaintenance#testSingleNodeWithOpenPipelineCanGotoMaintenance - #11643

Open
smengcl wants to merge 1 commit into
apache:masterfrom
smengcl:HDDS-17190-flaky
Open

smengcl wants to merge 1 commit into
apache:masterfrom
smengcl:HDDS-17190-flaky

Conversation

@smengcl

@smengcl smengcl commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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 of the whole class on this branch: passed 100/100

…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>
Copilot AI lite review requested due to automatic review settings October 20, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@smengcl
smengcl marked this pull request as ready for review October 20, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants