ChenSammi commented on code in PR #10214:
URL: https://github.com/apache/ozone/pull/10214#discussion_r3271448308
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerScanHelper.java:
##########
@@ -115,8 +115,17 @@ public void scanMetadata(Container<?> container)
logScanCompleted(containerData, now);
}
+ /**
+ * Marks container UNHEALTHY when the scan reports real errors.
+ * If every scan error is related to file-descriptor exhaustion, return
without marking container unhealthy.
+ */
public void handleUnhealthyScanResult(ContainerData containerData,
ScanResult result) throws IOException {
long containerID = containerData.getContainerID();
+ if (ScanTransientIOUtil.scanErrorsAreOnlyTooManyOpenFiles(result)) {
+ log.warn("Skipped marking container UNHEALTHY [{}]: scan failed due to
transient " +
+ "file descriptor exhaustion ('Too many open files'). {}",
containerID, result);
+ return;
+ }
Review Comment:
This is a good catch. We should avoid update scan timestamp, as it will
update the container file, which can also trigger another "too many open files"
failure. Same for checksum update.
@errose28 , currently handleUnhealthyScanResult is called after
updateContainerChecksum, is this order on purpose?
```
try {
controller.updateContainerChecksum(containerId,
result.getDataTree());
} catch (IOException ex) {
log.warn("Failed to update container checksum after scan of
container {}", containerId, ex);
}
if (result.hasErrors()) {
handleUnhealthyScanResult(containerData, result);
}
```
--
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]