-
Notifications
You must be signed in to change notification settings - Fork 592
HDDS-7654. EC: ReplicationManager - merge mis-rep queue into under replicated queue #4099
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,6 +159,7 @@ public class ReplicationManager implements SCMService { | |
| private ReplicationQueue replicationQueue; | ||
| private final ECUnderReplicationHandler ecUnderReplicationHandler; | ||
| private final ECOverReplicationHandler ecOverReplicationHandler; | ||
| private final ECMisReplicationHandler ecMisReplicationHandler; | ||
| private final RatisUnderReplicationHandler ratisUnderReplicationHandler; | ||
| private final RatisOverReplicationHandler ratisOverReplicationHandler; | ||
| private final int maintenanceRedundancy; | ||
|
|
@@ -223,6 +224,8 @@ public ReplicationManager(final ConfigurationSource conf, | |
| ecContainerPlacement, conf, nodeManager, this); | ||
| ecOverReplicationHandler = | ||
| new ECOverReplicationHandler(ecContainerPlacement, nodeManager); | ||
| ecMisReplicationHandler = new ECMisReplicationHandler(ecContainerPlacement, | ||
| conf, nodeManager); | ||
| ratisUnderReplicationHandler = new RatisUnderReplicationHandler( | ||
| ratisContainerPlacement, conf, nodeManager); | ||
| ratisOverReplicationHandler = | ||
|
|
@@ -525,8 +528,18 @@ public Map<DatanodeDetails, SCMCommand<?>> processUnderReplicatedContainer( | |
| List<ContainerReplicaOp> pendingOps = | ||
| containerReplicaPendingOps.getPendingOps(containerID); | ||
| if (result.getContainerInfo().getReplicationType() == EC) { | ||
| return ecUnderReplicationHandler.processAndCreateCommands(replicas, | ||
| pendingOps, result, maintenanceRedundancy); | ||
| if (result.getHealthState() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we create a separate method to processMisreplicatedContainer & have this if case in UnderReplicatedProcessor class?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: probably making it into a switch case would be a good.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually think we should have a single processUnhealthyContainer method, and in it, have a switch / IF that caters for EC / Ratis and then Over / Under / Mis replicated. But we should also add some tests for that, to ensure the correct handler is called in the correct circumstances. However the way RM is currently we would need to change it to inject the handlers, so I think we should clean this up in another refactor jira. |
||
| == ContainerHealthResult.HealthState.UNDER_REPLICATED) { | ||
| return ecUnderReplicationHandler.processAndCreateCommands(replicas, | ||
| pendingOps, result, maintenanceRedundancy); | ||
| } else if (result.getHealthState() | ||
| == ContainerHealthResult.HealthState.MIS_REPLICATED) { | ||
| return ecMisReplicationHandler.processAndCreateCommands(replicas, | ||
| pendingOps, result, maintenanceRedundancy); | ||
| } else { | ||
| throw new IllegalArgumentException("Unexpected health state: " | ||
| + result.getHealthState()); | ||
| } | ||
| } | ||
| return ratisUnderReplicationHandler.processAndCreateCommands(replicas, | ||
| pendingOps, result, ratisMaintenanceMinReplicas); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of constant value, can we have some priority based on the misreplication count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really convinced that mis-rep count really means much and it is worth ordering them further, as the container already has enough replicas. We want these to start with a lower priority than anything else (under rep, decommission), which setting it to 6 does. After that, we can only lower the priority further. If we have a mis rep count of 1 or 2 for a 3-2 and a 6-3 container, which is higher priority? I'm not sure about a good way to do this.