[ https://issues.apache.org/jira/browse/HDFS-17626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17885263#comment-17885263 ]
ASF GitHub Bot commented on HDFS-17626: --------------------------------------- KeeProMise commented on code in PR #7053: URL: https://github.com/apache/hadoop/pull/7053#discussion_r1778211573 ########## 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 alt="image" width="872" src="https://private-user-images.githubusercontent.com/55134131/369738260-ed4f9b82-8dbd-4a89-80b5-1263f982c782.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjc0MjQ4NzYsIm5iZiI6MTcyNzQyNDU3NiwicGF0aCI6Ii81NTEzNDEzMS8zNjk3MzgyNjAtZWQ0ZjliODItOGRiZC00YTg5LTgwYjUtMTI2M2Y5ODJjNzgyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTI3VDA4MDkzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWViMTllNTJmYWZiN2I5NjMxZDUyMDNlNmZiZGUyMGZlNjRiMjRmNDJjNGVmNTIwYjFmNmI3ZTI5ODA4OTM2MTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-iBwFzkAvy6JJOqsn_2Mpwe9MCFUgmJCNj6wSx7p1tk"> > @tomscut Got it, thanks, LGTM. > 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