From bd0dbf319abda642621cd35272b75626f4004605 Mon Sep 17 00:00:00 2001 From: Stephen O'Donnell Date: Wed, 6 Apr 2022 08:49:52 +0100 Subject: [PATCH] HDFS-16530. setReplication debug log creates a new string even if debug is disabled (#4142) (cherry picked from commit bbfe3500cf76ce661e0b10bb5d16cb419f9b9b10) --- .../org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java index 173348f356..5c347655fc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java @@ -408,7 +408,7 @@ static BlockInfo[] unprotectedSetReplication( bm.setReplication(oldBR, targetReplication, b); } - if (oldBR != -1) { + if (oldBR != -1 && FSDirectory.LOG.isDebugEnabled()) { if (oldBR > targetReplication) { FSDirectory.LOG.debug("Decreasing replication from {} to {} for {}", oldBR, targetReplication, iip.getPath());