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 2022/07/29 19:27:47 UTC

[GitHub] [ozone] umamaheswararao commented on a diff in pull request #3625: HDDS-7048. EC: Add debug logging with exception info when stripe write failed

umamaheswararao commented on code in PR #3625:
URL: https://github.com/apache/ozone/pull/3625#discussion_r933557367


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java:
##########
@@ -578,8 +578,16 @@ protected void loadDataBuffersFromStream()
         // an IOException.
         pair.getValue().get();
       } catch (ExecutionException ee) {
-        LOG.warn("Failed to read from block {} EC index {}. Excluding the " +
-            "block", getBlockID(), index + 1, ee.getCause());
+        String message = "Failed to read from block {} EC index {}. Excluding" +
+                " the block";
+        if (LOG.isDebugEnabled() || ee.getCause() == null) {
+          LOG.debug(message, getBlockID(), index + 1, ee.getCause());
+        } else {
+          LOG.warn(message + " Exception: {} Exception Message: {}",

Review Comment:
   We discussed this. if ee.getCause returns null, then we end up with NPE. Not when we may get getcause null though. Please safe guard it.



##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java:
##########
@@ -203,6 +206,25 @@ private void encodeAndWriteParityCells() throws IOException {
     }
   }
 
+  private void logStreamError(List<ECBlockOutputStream> failedStreams,
+                              String operation) {
+    Set<Integer> failedStreamIndexMap =

Review Comment:
   You may want to change this variable name to set.



##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java:
##########
@@ -203,6 +206,25 @@ private void encodeAndWriteParityCells() throws IOException {
     }
   }
 
+  private void logStreamError(List<ECBlockOutputStream> failedStreams,
+                              String operation) {
+    Set<Integer> failedStreamIndexMap =
+            failedStreams.stream().map(ECBlockOutputStream::getReplicationIndex)
+                    .collect(Collectors.toSet());
+
+    String failedStreamsString = IntStream.range(1,
+                    numDataBlks + numParityBlks + 1)
+            .mapToObj(index -> failedStreamIndexMap.contains(index)
+                    ? "F" : "S")
+            .collect(Collectors.joining(" "));
+    LOG.error("{} failed: {}", operation, failedStreamsString);

Review Comment:
   In EC we will actually proceed by closing current blockGroup. Should we change the log level to warn instead?



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