HDDS-7818. Modify Ratis Replication Handling in the new RM #4204
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?
This Jira is to modify the under and over replication handling to fit with the new changes introduced in HDDS-7804 and HDDS-7813. The respective handlers should deal with replicas that are not UNHEALTHY.
Mapping from Legacy to new RM:
closeReplicasIfPossible
->MismatchedReplicasHandler
: Difference is that handler will only close if there's a state mismatch between the container and the replica.handleUnderReplicatedHealthy
->RatisReplicationCheckHandler#handle
: The former tries to close mismatched replicas (which are called unhealthy in legacy) and does replication if more replicas are needed after sending close commands. The new one will close replicas inMismatchedReplicasHandler
and enqueue for under replication regardless of the number of close commands sent, provided some CLOSED or QUASI_CLOSED replicas are present (which can be replicated). It's essentially the same functionality.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7818
How was this patch tested?
Added unit tests. There's probably scope for some more. I'll check which tests are present in legacy and add any missing ones while this is being reviewed.
CI run in my fork: https://github.com/siddhantsangwan/ozone/actions/runs/3995725002/jobs/6861039576