GAOJHIHCYUAN commented on code in PR #4350:
URL: https://github.com/apache/ozone/pull/4350#discussion_r1130348902


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java:
##########
@@ -79,16 +79,18 @@ private ContainerUtils() {
   public static ContainerCommandResponseProto logAndReturnError(
       Logger log, StorageContainerException ex,
       ContainerCommandRequestProto request) {
-    String logInfo = "Operation: {} , Trace ID: {} , Message: {} , " +
-        "Result: {} , StorageContainerException Occurred.";
+    String logInfo = "Operation: {} , Trace ID: {} , Block ID: {} , " +
+        "Message: {} , Result: {} , StorageContainerException Occurred.";
     if (ex.getResult() == CLOSED_CONTAINER_IO ||
         ex.getResult() == CONTAINER_NOT_OPEN) {
       if (log.isDebugEnabled()) {
         log.debug(logInfo, request.getCmdType(), request.getTraceID(),
+            request.getGetBlock().getBlockID(),
             ex.getMessage(), ex.getResult().getValueDescriptor().getName(), 
ex);
       }
     } else {
-      log.info(logInfo, request.getCmdType(), request.getTraceID(),
+      log.warn(logInfo, request.getCmdType(), request.getTraceID(),
+              request.getGetBlock().getBlockID(),

Review Comment:
   > `request.getGetBlock()` is only applicable to `GetBlock` requests. Also, 
not all commands are related to blocks anyway.
   > 
   > Looking at [HDDS-8010](https://issues.apache.org/jira/browse/HDDS-8010), I 
think the goal is to change the message in:
   > 
   > 
https://github.com/apache/ozone/blob/4afa68e4605dd3b0c9692877a1e9ddf85ce7a740/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java#L353-L364
   
   because the log was logged when StorageContainerException occurred
   my opinion was overload the StorageContainerException and give the block ID 
parameter make its throw block ID back.
   Idk is it a good soultion.
   thanks you so much
   
   > @GAOJHIHCYUAN have you observed the updated message in the log?
   
   No,I haven't
   I will try how could I observe the updated message.
   sorry,i was a newbie. I'm still learning.
   thanks you so much.



-- 
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]

Reply via email to