Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-7818. Modify Ratis Replication Handling in the new RM #4204

Merged
merged 5 commits into from Jan 26, 2023

Conversation

siddhantsangwan
Copy link
Contributor

@siddhantsangwan siddhantsangwan commented Jan 24, 2023

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:

  1. closeReplicasIfPossible -> MismatchedReplicasHandler: Difference is that handler will only close if there's a state mismatch between the container and the replica.
  2. 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 in MismatchedReplicasHandler 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.
  3. A container will be queued for over replication only if it doesn't have any mismatched replicas.

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

public void testSufficientReplicationWithMismatchedReplicas() {
ContainerInfo container = createContainerInfo(repConfig);
Set<ContainerReplica> replicas
= createReplicas(container.containerID(), State.CLOSING, 0, 0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these mis-matches as the container is CLOSED, but the replicas are CLOSING?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

@sodonnel sodonnel left a comment

Choose a reason for hiding this comment

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

LGTM

@sodonnel sodonnel merged commit 4c6c121 into apache:master Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants