errose28 commented on code in PR #4901:
URL: https://github.com/apache/ozone/pull/4901#discussion_r1240428658
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -1352,9 +1366,11 @@ private void deleteInternal(Container container, boolean
force)
// empty as a defensive check.
LOG.error("Could not determine if the container {} is empty",
container.getContainerData().getContainerID(), e);
- throw new StorageContainerException("Could not determine if container "
- + container.getContainerData().getContainerID() +
- " is empty", DELETE_ON_NON_EMPTY_CONTAINER);
+ String errorMsg =
+ "Could not determine if the container " +
container.getContainerData()
+ .getContainerID() + "is empty";
+ triggerVolumeScanAndThrowException(container, errorMsg,
+ DELETE_ON_NON_EMPTY_CONTAINER);
Review Comment:
I think this should also be `CONTAINER_INTERNAL_ERROR`.
`DELETE_ON_NON_EMPTY_CONTAINER` should be reserved for the case where SCM
incorrectly sent a non-force delete to a non-empty container, which is not
necessarily what happened here.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -1363,4 +1369,12 @@ private void deleteInternal(Container container, boolean
force)
container.getContainerData().setState(State.DELETED);
sendICR(container);
}
+
+ private void triggerVolumeScanAndThrowException(Container container,
Review Comment:
Right. There is a configurable gap between scans of the same volume (15
minutes is the current default). So we can queue volumes for scanning whenever
we have an error, and the scanner will discard them if it recently scanned the
volume.
--
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]