HDFS-12619. Do not catch and throw unchecked exceptions if IBRs fail to process. Contributed by Wei-Chiu Chuang.

(cherry picked from commit 4ab0c8f96a41c573cc1f1e71c18871d243f952b9)
This commit is contained in:
Wei-Chiu Chuang 2017-10-19 06:17:59 -07:00 committed by vrushali
parent a47e8e660f
commit 3ed7a2ca42

View File

@ -3443,11 +3443,15 @@ public void processIncrementalBlockReport(final DatanodeID nodeID,
throw new IOException( throw new IOException(
"Got incremental block report from unregistered or dead node"); "Got incremental block report from unregistered or dead node");
} }
boolean successful = false;
try { try {
processIncrementalBlockReport(node, srdb); processIncrementalBlockReport(node, srdb);
} catch (Exception ex) { successful = true;
node.setForceRegistration(true); } finally {
throw ex; if (!successful) {
node.setForceRegistration(true);
}
} }
} }