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

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

tomscut commented on code in PR #7053:
URL: https://github.com/apache/hadoop/pull/7053#discussion_r1770720963


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java:
##########
@@ -258,7 +258,7 @@ NamespaceInfo retrieveNamespaceInfo() throws IOException {
     while (shouldRun()) {
       try {
         nsInfo = bpNamenode.versionRequest();
-        LOG.debug(this + " received versionRequest response: " + nsInfo);
+        LOG.debug("{} received versionRequest response: {}", this, nsInfo);

Review Comment:
   > HI, IMO, "if (LOG.isDebugEnabled()) {...}" is better.
   
   Thanks for your comment. I agree with @ayushtkn and @virajjasani here. 
LOG.debug already does isDebugEnabled() internally.
   <img width="872" alt="image" 
src="https://github.com/user-attachments/assets/ed4f9b82-8dbd-4a89-80b5-1263f982c782";>





> Reduce lock contention at datanode startup
> ------------------------------------------
>
>                 Key: HDFS-17626
>                 URL: https://issues.apache.org/jira/browse/HDFS-17626
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Tao Li
>            Assignee: Tao Li
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: image-2024-09-18-20-45-56-999.png
>
>
> During the datanode startup process, there is a debug log, because there is 
> no LOG.isDebugEnabled() guard, so even if debug is not enabled, the read lock 
> will be obtained. The guard should be added here to reduce lock contention.
> !image-2024-09-18-20-45-56-999.png|width=333,height=263!
> !https://docs.corp.vipshop.com/uploader/f/4DSEukZKf6cV5VRY.png?accessToken=eyJhbGciOiJIUzI1NiIsImtpZCI6ImRlZmF1bHQiLCJ0eXAiOiJKV1QifQ.eyJleHAiOjE3MjY2NjQxNjYsImZpbGVHVUlEIjoiQWxvNE5uOU9OYko2aDJ4WCIsImlhdCI6MTcyNjY2MzU2NiwiaXNzIjoidXBsb2FkZXJfYWNjZXNzX3Jlc291cmNlIiwidXNlcklkIjo2MTYyMTQwfQ.DwDBnJ6I8vCFd14A-wsq2oLU5a0rcPoUvq49Z4aWg2A|width=334,height=133!



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