sodonnel commented on code in PR #4773:
URL: https://github.com/apache/ozone/pull/4773#discussion_r1218137859
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java:
##########
@@ -179,21 +182,35 @@ public int containerCount() {
return containerMap.size();
}
- public void handleVolumeFailures() {
+ /**
+ * Remove all containers belonging to failed volume.
+ * Send FCR which will not contain removed containers.
+ *
+ * @param context StateContext
+ * @return
+ */
+ public void handleVolumeFailures(StateContext context) {
+ AtomicBoolean failedVolume = new AtomicBoolean(false);
containerMap.values().forEach(c -> {
if (c.getContainerData().getVolume().isFailed()) {
- try {
- c.markContainerUnhealthy();
- LOG.info("Marking Container {} UNHEALTHY as the Volume {} " +
+ removeContainer(c.getContainerData().getContainerID());
+ LOG.info("Removing Container {} as the Volume {} " +
Review Comment:
This may be a bit verbose. A volume could have several 1000 containers on
it, so perhaps it would be better to keep a counter and log a single message
saying "removed X containers on failed volumes" rather than logging every
containerID? Might be worth keeping the existing message but at debug level.
--
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]