From 11bdcb754a8f6abcc730a9a22a4a9513f7719240 Mon Sep 17 00:00:00 2001 From: Yongjun Zhang Date: Mon, 29 Jun 2015 14:35:39 -0700 Subject: [PATCH] HDFS-8659. Block scanner INFO message is spamming logs. Contributed by Yongjun Zhang. (cherry picked from commit 43a1288fff5e323895fde66b9e3eb31a7412fcc2) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../apache/hadoop/hdfs/server/datanode/BlockScanner.java | 2 +- .../apache/hadoop/hdfs/server/datanode/VolumeScanner.java | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index d2b276187ba..5db053f4436 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -652,6 +652,8 @@ Release 2.7.2 - UNRELEASED IMPROVEMENTS + HDFS-8659. Block scanner INFO message is spamming logs. (Yongjun Zhang) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockScanner.java index 9c4dd10f005..be6aa83ce6a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockScanner.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockScanner.java @@ -317,7 +317,7 @@ public class BlockScanner { */ synchronized void markSuspectBlock(String storageId, ExtendedBlock block) { if (!isEnabled()) { - LOG.info("Not scanning suspicious block {} on {}, because the block " + + LOG.debug("Not scanning suspicious block {} on {}, because the block " + "scanner is disabled.", block, storageId); return; } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java index 615abe91f0e..ff655c27bdf 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java @@ -656,24 +656,24 @@ public class VolumeScanner extends Thread { public synchronized void markSuspectBlock(ExtendedBlock block) { if (stopping) { - LOG.info("{}: Not scheduling suspect block {} for " + + LOG.debug("{}: Not scheduling suspect block {} for " + "rescanning, because this volume scanner is stopping.", this, block); return; } Boolean recent = recentSuspectBlocks.getIfPresent(block); if (recent != null) { - LOG.info("{}: Not scheduling suspect block {} for " + + LOG.debug("{}: Not scheduling suspect block {} for " + "rescanning, because we rescanned it recently.", this, block); return; } if (suspectBlocks.contains(block)) { - LOG.info("{}: suspect block {} is already queued for " + + LOG.debug("{}: suspect block {} is already queued for " + "rescanning.", this, block); return; } suspectBlocks.add(block); recentSuspectBlocks.put(block, true); - LOG.info("{}: Scheduling suspect block {} for rescanning.", this, block); + LOG.debug("{}: Scheduling suspect block {} for rescanning.", this, block); notify(); // wake scanner thread. }