You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2023/01/18 19:47:31 UTC

[GitHub] [ozone] errose28 commented on a diff in pull request #4169: HDDS-7097. Container scanner log output lacks useful information

errose28 commented on code in PR #4169:
URL: https://github.com/apache/ozone/pull/4169#discussion_r1074003948


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java:
##########
@@ -398,9 +396,7 @@ private void loadContainerData() throws IOException {
   }
 
   private void handleCorruption(IOException e) {
-    String errStr =
-        "Corruption detected in container: [" + containerID + "] ";
-    String logMessage = errStr + "Exception: [" + e.getMessage() + "]";
-    LOG.error(logMessage);
+    LOG.error("Marking Container [{}] UNHEALTHY as it failed metadata check." +
+                    " Exception: {}", containerID, e);

Review Comment:
   ```suggestion
       LOG.error("Corruption detected in container [{}]. Marking it UNHEALTHY.", containerID, e);
   ```
   
   Technically the metadata or the data (the actual blocks) may have been corrupted when this method is called. The exception should tell us which one it is. Also we can let the logger handle the exception printing directly without needing to pass it as a string format arg.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org