HDDS-16405. ReplicationManagerReport should not be used for transient state - #11230
Open
sodonnel wants to merge 2 commits into
Open
HDDS-16405. ReplicationManagerReport should not be used for transient state#11230sodonnel wants to merge 2 commits into
sodonnel wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The moderate, three-vote finding leaves the read-only classification path with stale health state.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
HDDS-16405 moves transient container health state from ReplicationManagerReport into ContainerCheckRequest while preserving aggregate reporting.
Changes:
- Centralizes health-state updates and report sampling.
- Updates replication health handlers to use request state.
- Removes transient report state and adds unit coverage.
File summaries
| File | Summary |
|---|---|
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestContainerCheckRequest.java |
Tests request health-state and report synchronization. |
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/health/TestQuasiClosedStuckReplicationCheck.java |
Removes obsolete report reset. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java |
Uses request health state during processing. Moderate finding (3 votes): the read-only path can leave stale health state because the result is not copied back. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/VulnerableUnhealthyReplicasHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/RatisUnhealthyReplicationCheckHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/RatisReplicationCheckHandler.java |
Uses centralized request health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/QuasiClosedStuckReplicationCheck.java |
Uses centralized request health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/QuasiClosedContainerHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/OpenContainerHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/EmptyContainerHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/ECReplicationCheckHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/ECMisReplicationCheckHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/ClosingContainerHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/ClosedWithUnhealthyReplicasHandler.java |
Uses request-based health-state updates. |
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ContainerCheckRequest.java |
Stores per-request health state and updates report statistics. |
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManagerReport.java |
Removes transient per-container health-state storage. |
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
What changes were proposed in this pull request?
In a recent change ReplicationManagerReport gained an extra field to track the end health state of a container when it is processed. While this resulted in a smaller code change, this not how RMReport is supposed to be used and it was intended to have aggregated stats, not per request stats. We already have the ContainerCheckRequest object which has all details of a request and any result can be set in there.
This change removes the transient per container state from RMReport and moves the result into ContainerCheckRequest where it is better suited. It also centralizes the report "increment and sample" so the state and increment are performed together with a single call from the handlers.
Also added a new test in TestContainerCheckRequest to ensure that when calling request.setHealthState() it updates the report and sets the heath result, which avoids having to update all the sets that assert on the report state, as that would have made this change a lot larger.
This change is needed before #11199 can move forward as it starts to build on the pattern added to the report.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16405
How was this patch tested?
Existing tests and a new unit test.