siddhantsangwan commented on code in PR #3920:
URL: https://github.com/apache/ozone/pull/3920#discussion_r1050062099
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/LegacyReplicationManager.java:
##########
@@ -523,22 +523,32 @@ protected void processContainer(ContainerInfo container,
boolean sufficientlyReplicated = replicaSet.isSufficientlyReplicated();
boolean placementSatisfied = placementStatus.isPolicySatisfied();
if (!sufficientlyReplicated || !placementSatisfied) {
- if (!sufficientlyReplicated) {
+ // Increment report stats.
+ if (!sufficientlyReplicated && replicaSet.isUnrecoverable()) {
+ report.incrementAndSample(HealthState.MISSING,
+ container.containerID());
report.incrementAndSample(
HealthState.UNDER_REPLICATED, container.containerID());
- if (replicaSet.isUnrecoverable()) {
- report.incrementAndSample(HealthState.MISSING,
- container.containerID());
- }
}
if (!placementSatisfied) {
report.incrementAndSample(HealthState.MIS_REPLICATED,
container.containerID());
}
+ // Replicate container if needed.
if (!inflightReplication.isFull() || !inflightDeletion.isFull()) {
- handleUnderReplicatedContainer(container,
- replicaSet, placementStatus);
+ if (!replicaSet.isUnrecoverable()) {
+ if (replicaSet.getHealthyReplicaCount() == 0 &&
+ replicaSet.getUnhealthyReplicaCount() != 0) {
+ handleAllReplicasUnhealthy(container, replicaSet,
+ placementStatus, report);
+ } else {
+ report.incrementAndSample(
+ HealthState.UNDER_REPLICATED, container.containerID());
+ handleUnderReplicatedHealthy(container,
+ replicaSet, placementStatus);
+ }
+ }
Review Comment:
I think this logic will not update this container's under replicated state
in the report if it's recoverable and those maps are full
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]