diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java index 4f0ec43e231..a49cb248a23 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java @@ -3443,11 +3443,15 @@ public class BlockManager implements BlockStatsMXBean { throw new IOException( "Got incremental block report from unregistered or dead node"); } + + boolean successful = false; try { processIncrementalBlockReport(node, srdb); - } catch (Exception ex) { - node.setForceRegistration(true); - throw ex; + successful = true; + } finally { + if (!successful) { + node.setForceRegistration(true); + } } }