print log when block report processing fail.
@@ -2071,9 +2071,10 @@ public boolean processReport(final DatanodeID nodeID,
" because namenode still in startup phase");
return !node.hasStaleStorages();
}
-
+ ReportStatistics reportStatistics = null;
+ try {
// Get the storageinfo object that we are updating in this processreport
- ReportStatistics reportStatistics = processReport(storageInfo, newReport);
+ reportStatistics = processReport(storageInfo, newReport);
// Now that we have an up-to-date block report, we know that any
// deletions from a previous NN iteration have been accounted for.
@@ -2081,9 +2082,8 @@ public boolean processReport(final DatanodeID nodeID,
storageInfo.receivedBlockReport();
if (staleBefore && !storageInfo.areBlockContentsStale()) {
LOG.info(
- "BLOCK* processReport: Received first block report from " + node +
- " after becoming active. Its block contents are no longer" +
- " considered stale");
+ "BLOCK* processReport: Received first block report from " + node
+ + " after becoming active. Its block contents are no longer" + " considered stale");
rescanPostponedMisreplicatedBlocks();
}
@@ -2094,10 +2094,15 @@ public boolean processReport(final DatanodeID nodeID,
if (metrics != null) {
metrics.addBlockReport((int) (endTime - startTime));
}
- blockLog.info("BLOCK* processReport: from " + nodeID + " storage: " + storage + ", blocks: " +
- newReport.getNumberOfBlocks() + ", processing time: " +
- (endTime - startTime) + " ms. " + reportStatistics);
+ blockLog.info("BLOCK* processReport success: from " + nodeID + " storage: " + storage + ", blocks: " + newReport.
+ getNumberOfBlocks() + ", processing time: " + (endTime - startTime) + " ms. " + reportStatistics);
return !node.hasStaleStorages();
+ } catch (Throwable t) {
+ final long endTime = Time.now();
+ blockLog.error("BLOCK* processReport fail: from " + nodeID + " storage: " + storage + ", blocks: " + newReport.
+ getNumberOfBlocks() + ", processing time: " + (endTime - startTime) + " ms. " + reportStatistics, t);
+ throw t;
+ }
}
/**
@@ -2165,9 +2170,7 @@ public Object performTask() throws IOException {
}
@VisibleForTesting
- public ReportStatistics processReport(
- final DatanodeStorageInfo storage,
- final BlockReport report) throws
+ public ReportStatistics processReport(final DatanodeStorageInfo storage,final BlockReport report) throws
IOException {
// Normal case:
// Modify the (block-->datanode) map, according to the difference
@@ -3515,8 +3518,6 @@ public void removeStoredBlock(Block block, DatanodeDescriptor node)
// }catch(Exception e){
// LOG.error(e);
// }
- blockLog.info("BLOCK* removeStoredBlock: " + block +
- " has already been removed from node " + node);
//
// It's possible that the block was removed because of a datanode
// failure. If the block is still valid, check if replication is
