goiri commented on code in PR #6094:
URL: https://github.com/apache/hadoop/pull/6094#discussion_r1330440303


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java:
##########
@@ -427,26 +426,41 @@ protected void recover() throws IOException {
               // simply choose the one with larger length.
               // TODO: better usage of redundant replicas
               syncBlocks.put(blockId, new BlockRecord(id, proxyDN, info));
+            } else {
+              if (LOG.isDebugEnabled()) {

Review Comment:
   No need to run isDebugEnabled() if you use {}



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java:
##########
@@ -427,26 +426,41 @@ protected void recover() throws IOException {
               // simply choose the one with larger length.
               // TODO: better usage of redundant replicas
               syncBlocks.put(blockId, new BlockRecord(id, proxyDN, info));
+            } else {
+              if (LOG.isDebugEnabled()) {
+                LOG.debug("Block recovery: Ignored replica with invalid " +
+                    "original state: {} from DataNode: {} by block: {}", info, 
id, block);
+              }
+            }
+          } else {
+            if (LOG.isDebugEnabled()) {
+              if (info == null) {
+                LOG.debug("Block recovery: DataNode: {} does not have " +
+                    "replica for block: (block={}, internalBlk={})", id, 
block, internalBlk);
+              } else {
+                LOG.debug("Block recovery: Ignored replica with invalid "
+                    + "generation stamp or length: {} from DataNode: {} by 
block: {}",
+                    info, id, block);
+              }
             }
           }
         } catch (RecoveryInProgressException ripE) {
           InterDatanodeProtocol.LOG.warn(
-              "Recovery for replica " + block + " on data-node " + id
-                  + " is already in progress. Recovery id = "
-                  + rBlock.getNewGenerationStamp() + " is aborted.", ripE);
+              "Recovery for replica (block={}, internalBlk={}) on data-node {} 
is already " +
+                  "in progress. Recovery id = {} is aborted.", block, 
internalBlk, id,
+              rBlock.getNewGenerationStamp(), ripE);
           return;
         } catch (IOException e) {
-          InterDatanodeProtocol.LOG.warn("Failed to recover block (block="
-              + block + ", datanode=" + id + ")", e);
+          InterDatanodeProtocol.LOG.warn("Failed to recover block (block={}, 
internalBlk={}, " +
+                  "datanode={})", block, internalBlk, id, e);
         }
       }
       checkLocations(syncBlocks.size());
 
       final long safeLength = getSafeLength(syncBlocks);
       if (LOG.isDebugEnabled()) {

Review Comment:
   Avoid now that you use {}



-- 
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: common-issues-unsubscr...@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to