Xushaohong commented on code in PR #3615:
URL: https://github.com/apache/ozone/pull/3615#discussion_r934421754
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/LegacyReplicationManager.java:
##########
@@ -1221,12 +1221,24 @@ private void handleUnderReplicatedContainer(final
ContainerInfo container,
id, misRepDelta);
}
} else {
+ replicas.stream().filter(rp -> rp.getState().equals(State.UNHEALTHY))
+ .forEach(rp -> {
+ sendDeleteCommand(container, rp.getDatanodeDetails(), true);
+ LOG.info("Send deleteCmd to force delete the unhealthy " +
+ "replica {}", rp);
+ });
+ container.setNumberOfKeys(0);
+ container.setUsedBytes(0);
+ containerManager.updateContainerState(container.containerID(),
+ HddsProtos.LifeCycleEvent.DELETE);
LOG.warn("Cannot replicate container {}, no healthy replica found.",
container.containerID());
}
} catch (IOException | IllegalStateException ex) {
LOG.warn("Exception while replicating container {}.",
container.getContainerID(), ex);
+ } catch (InvalidStateTransitionException | TimeoutException e) {
+ e.printStackTrace();
Review Comment:
My mistake, this is my temp solution to the unhealthy containers, not the
part of this patch.
--
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]