Skip to content

Commit

Permalink
HDDS-8111. ReplicationManager: Add RatisMisReplicationHandler into rm…
Browse files Browse the repository at this point in the history
….processUnderReplicatedContainer (#4414)
  • Loading branch information
sodonnel committed Mar 17, 2023
1 parent 1c30a35 commit c14200c
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public class ReplicationManager implements SCMService {
private final ECMisReplicationHandler ecMisReplicationHandler;
private final RatisUnderReplicationHandler ratisUnderReplicationHandler;
private final RatisOverReplicationHandler ratisOverReplicationHandler;
private final RatisMisReplicationHandler ratisMisReplicationHandler;
private final int maintenanceRedundancy;
private final int ratisMaintenanceMinReplicas;
private Thread underReplicatedProcessorThread;
Expand Down Expand Up @@ -239,6 +240,8 @@ public ReplicationManager(final ConfigurationSource conf,
ratisContainerPlacement, conf, this);
ratisOverReplicationHandler =
new RatisOverReplicationHandler(ratisContainerPlacement, this);
ratisMisReplicationHandler = new RatisMisReplicationHandler(
ratisContainerPlacement, conf, this, rmConf.isPush());
underReplicatedProcessor =
new UnderReplicatedProcessor(this,
rmConf.getUnderReplicatedInterval());
Expand Down Expand Up @@ -682,8 +685,18 @@ int processUnderReplicatedContainer(
+ result.getHealthState());
}
}
return ratisUnderReplicationHandler.processAndSendCommands(replicas,
pendingOps, result, ratisMaintenanceMinReplicas);
if (result.getHealthState()
== ContainerHealthResult.HealthState.UNDER_REPLICATED) {
return ratisUnderReplicationHandler.processAndSendCommands(replicas,
pendingOps, result, ratisMaintenanceMinReplicas);
} else if (result.getHealthState()
== ContainerHealthResult.HealthState.MIS_REPLICATED) {
return ratisMisReplicationHandler.processAndSendCommands(replicas,
pendingOps, result, ratisMaintenanceMinReplicas);
} else {
throw new IllegalArgumentException("Unexpected health state: "
+ result.getHealthState());
}
}

int processOverReplicatedContainer(
Expand Down

0 comments on commit c14200c

Please sign in to comment.