[ 
https://issues.apache.org/jira/browse/HDFS-17194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17770050#comment-17770050
 ] 

ASF GitHub Bot commented on HDFS-17194:
---------------------------------------

haiyang1987 commented on PR #6094:
URL: https://github.com/apache/hadoop/pull/6094#issuecomment-1739132680

   > @goiri I am bit curious on removing the isDebugEnabled checks. Like here
   > 
   > ```
   > -          if (LOG.isDebugEnabled()) {
   > -            LOG.debug("syncBlock replicaInfo: block=" + block +
   > -                ", from datanode " + r.id + ", receivedState=" + 
rState.name() +
   > -                ", receivedLength=" + r.rInfo.getNumBytes() +
   > -                ", bestState=FINALIZED, finalizedLength=" + 
finalizedLength);
   > -          }
   > +          LOG.debug("syncBlock replicaInfo: block={}, from datanode {}, 
receivedState={}, " +
   > +              "receivedLength={}, bestState=FINALIZED, 
finalizedLength={}",
   > +              block, r.id, rState.name(), r.rInfo.getNumBytes(), 
finalizedLength);
   >          }
   > ```
   > 
   > There are method calls like `r.rInfo.getNumBytes()` these will be called & 
resolved irrespective whether debug logging is enabled or not, right? Even the 
concat on will be performed before passing to `LOG.debug`, Wouldn't it be 
better to have a `isDebug` gaurd where there are method calls or the log 
message is big & we use concat.
   > 
   > I am good with current as well
   
   Thanks @ayushtkn for your review.
   Indeed, it may be better to add if (`LOG.isDebugEnabled()`) here in terms of 
performance, If `LOG.isDebugEnabled `is false, it will not be called & resolved 
`r.rInfo.getNumBytes()`.
   view previous PRs https://github.com/apache/hadoop/pull/4480 and 
https://github.com/apache/hadoop/pull/4529 mentioned about Logging 
performance,there are method calls or the log message is large  & we use concat 
It may be better to use `DebugEnabled()` to judge.
   
   So here we maybe need to update the code and add `LOG.isDebugEnabled()`,what 
do you think about it ? @goiri @ayushtkn 
   
   




> Enhance the log message for striped block recovery
> --------------------------------------------------
>
>                 Key: HDFS-17194
>                 URL: https://issues.apache.org/jira/browse/HDFS-17194
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Haiyang Hu
>            Assignee: Haiyang Hu
>            Priority: Major
>              Labels: pull-request-available
>
> In order to convenient troubleshoot problems, consider add internalBlk 
> information to the RecoveryTaskStriped#recover log message and optimize some 
> log output



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to