Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,16 @@ public boolean handle(ContainerCheckRequest request) {
// handler so return as unhandled so any further handlers will be tried.
return false;
}
// TODO - should the report have a HEALTHY state, rather than just bad
// states? It would need to be added to legacy RM too.
if (health.getHealthState()
== ContainerHealthResult.HealthState.UNDER_REPLICATED) {
report.incrementAndSample(
ReplicationManagerReport.HealthState.UNDER_REPLICATED, containerID);
ContainerHealthResult.UnderReplicatedHealthResult underHealth
= ((ContainerHealthResult.UnderReplicatedHealthResult) health);
if (underHealth.isUnrecoverable()) {
// TODO - do we need a new health state for unrecoverable EC?
report.incrementAndSample(
ReplicationManagerReport.HealthState.MISSING, containerID);
} else {
report.incrementAndSample(
ReplicationManagerReport.HealthState.UNDER_REPLICATED, containerID);
}
if (!underHealth.isReplicatedOkAfterPending() &&
(!underHealth.isUnrecoverable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ public boolean handle(ContainerCheckRequest request) {
return false;
}

report.incrementAndSample(
ReplicationManagerReport.HealthState.UNDER_REPLICATED,
container.containerID());
LOG.debug("Container {} is Under Replicated. isReplicatedOkAfterPending" +
" is [{}]. isUnrecoverable is [{}]. hasHealthyReplicas is [{}].",
container,
Expand All @@ -103,6 +100,10 @@ public boolean handle(ContainerCheckRequest request) {
container.containerID());
return true;
}
report.incrementAndSample(
ReplicationManagerReport.HealthState.UNDER_REPLICATED,
container.containerID());

if (!underHealth.isReplicatedOkAfterPending() &&
underHealth.hasHealthyReplicas()) {
request.getReplicationQueue().enqueue(underHealth);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public void testUnderReplicatedAndUnrecoverable()
// replication list. It will be checked again on the next RM run.
Assert.assertEquals(0, repQueue.underReplicatedQueueSize());
Assert.assertEquals(0, repQueue.overReplicatedQueueSize());
Assert.assertEquals(1, repReport.getStat(
Assert.assertEquals(0, repReport.getStat(
ReplicationManagerReport.HealthState.UNDER_REPLICATED));
Assert.assertEquals(1, repReport.getStat(
ReplicationManagerReport.HealthState.MISSING));
Expand Down Expand Up @@ -492,7 +492,7 @@ public void testUnrecoverableClosedContainerWithUnhealthyReplicas()

Assert.assertEquals(0, repQueue.underReplicatedQueueSize());
Assert.assertEquals(0, repQueue.overReplicatedQueueSize());
Assert.assertEquals(1, repReport.getStat(
Assert.assertEquals(0, repReport.getStat(
ReplicationManagerReport.HealthState.UNDER_REPLICATED));
Assert.assertEquals(1, repReport.getStat(
ReplicationManagerReport.HealthState.MISSING));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public void testUnderReplicatedAndUnrecoverable() {
// Unrecoverable so not added to the queue
Assert.assertEquals(0, repQueue.underReplicatedQueueSize());
Assert.assertEquals(0, repQueue.overReplicatedQueueSize());
Assert.assertEquals(1, report.getStat(
Assert.assertEquals(0, report.getStat(
ReplicationManagerReport.HealthState.UNDER_REPLICATED));
Assert.assertEquals(1, report.getStat(
ReplicationManagerReport.HealthState.MISSING));
Expand Down Expand Up @@ -310,7 +310,7 @@ private void testUnderReplicatedAndUnrecoverableWithOffline(
// Unrecoverable so not added to the queue
Assert.assertEquals(1, repQueue.underReplicatedQueueSize());
Assert.assertEquals(0, repQueue.overReplicatedQueueSize());
Assert.assertEquals(1, report.getStat(
Assert.assertEquals(0, report.getStat(
ReplicationManagerReport.HealthState.UNDER_REPLICATED));
Assert.assertEquals(1, report.getStat(
ReplicationManagerReport.HealthState.MISSING));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public void testUnderReplicatedAndUnrecoverable() {
// Unrecoverable, so not added to the queue.
Assert.assertEquals(0, repQueue.underReplicatedQueueSize());
Assert.assertEquals(0, repQueue.overReplicatedQueueSize());
Assert.assertEquals(1, report.getStat(
Assert.assertEquals(0, report.getStat(
ReplicationManagerReport.HealthState.UNDER_REPLICATED));
Assert.assertEquals(1, report.getStat(
ReplicationManagerReport.HealthState.MISSING));
Expand Down