sodonnel commented on code in PR #10255:
URL: https://github.com/apache/ozone/pull/10255#discussion_r3275220288
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java:
##########
@@ -314,19 +314,23 @@ private boolean updateContainerState(final
DatanodeDetails datanode,
deleteReplica(containerId, datanode, publisher, "DELETED", false,
detailsForLogging);
return false;
}
- if
(container.getReplicationType().equals(HddsProtos.ReplicationType.EC)) {
+ if (replicationType.equals(HddsProtos.ReplicationType.EC)) {
// In case of EC container, delete its replica to avoid orphan replica
deleteReplica(containerId, datanode, publisher, "DELETED", true,
detailsForLogging);
return false;
}
// HDDS-12421: fall-through to case DELETING
case DELETING:
+ if (replicationType.equals(HddsProtos.ReplicationType.EC) &&
!replicaIsEmpty) {
Review Comment:
This change makes sense. However it is kind of annoying it is in the
ReportHandler rather than the RM deleting handler. There is existing logic in
this handler in the DELETING branch of the switch statement for both Ratis and
EC, so it makes sense to put in here.
A container transitions to deleting when all its reported replicas are
empty. Then it transitions to deleted when all the replicas are gone. If a non
empty replica appears after it has transitioned to deleting then it will block
the deleting to deleted transition as the RM code will not remove the replica
as its non-empty.
What is also interesting is that if the non-empty container appears before
the container goes from CLOSED to DELETING, then it would block the container
going to DELETING and hence clearing out the other empty replicas. In that case
there should be an over replicated index, but I am not sure which RM would
remove.
--
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]