|
@@ -2702,6 +2702,8 @@ public class BlockManager implements BlockStatsMXBean {
|
|
Collection<Block> invalidatedBlocks = Collections.emptyList();
|
|
Collection<Block> invalidatedBlocks = Collections.emptyList();
|
|
String strBlockReportId =
|
|
String strBlockReportId =
|
|
context != null ? Long.toHexString(context.getReportId()) : "";
|
|
context != null ? Long.toHexString(context.getReportId()) : "";
|
|
|
|
+ String fullBrLeaseId =
|
|
|
|
+ context != null ? Long.toHexString(context.getLeaseId()) : "";
|
|
|
|
|
|
try {
|
|
try {
|
|
node = datanodeManager.getDatanode(nodeID);
|
|
node = datanodeManager.getDatanode(nodeID);
|
|
@@ -2724,10 +2726,10 @@ public class BlockManager implements BlockStatsMXBean {
|
|
if (namesystem.isInStartupSafeMode()
|
|
if (namesystem.isInStartupSafeMode()
|
|
&& !StorageType.PROVIDED.equals(storageInfo.getStorageType())
|
|
&& !StorageType.PROVIDED.equals(storageInfo.getStorageType())
|
|
&& storageInfo.getBlockReportCount() > 0) {
|
|
&& storageInfo.getBlockReportCount() > 0) {
|
|
- blockLog.info("BLOCK* processReport 0x{}: "
|
|
|
|
|
|
+ blockLog.info("BLOCK* processReport 0x{} with lease ID 0x{}: "
|
|
+ "discarded non-initial block report from {}"
|
|
+ "discarded non-initial block report from {}"
|
|
+ " because namenode still in startup phase",
|
|
+ " because namenode still in startup phase",
|
|
- strBlockReportId, nodeID);
|
|
|
|
|
|
+ strBlockReportId, fullBrLeaseId, nodeID);
|
|
blockReportLeaseManager.removeLease(node);
|
|
blockReportLeaseManager.removeLease(node);
|
|
return !node.hasStaleStorages();
|
|
return !node.hasStaleStorages();
|
|
}
|
|
}
|
|
@@ -2735,9 +2737,9 @@ public class BlockManager implements BlockStatsMXBean {
|
|
if (storageInfo.getBlockReportCount() == 0) {
|
|
if (storageInfo.getBlockReportCount() == 0) {
|
|
// The first block report can be processed a lot more efficiently than
|
|
// The first block report can be processed a lot more efficiently than
|
|
// ordinary block reports. This shortens restart times.
|
|
// ordinary block reports. This shortens restart times.
|
|
- blockLog.info("BLOCK* processReport 0x{}: Processing first "
|
|
|
|
|
|
+ blockLog.info("BLOCK* processReport 0x{} with lease ID 0x{}: Processing first "
|
|
+ "storage report for {} from datanode {}",
|
|
+ "storage report for {} from datanode {}",
|
|
- strBlockReportId,
|
|
|
|
|
|
+ strBlockReportId, fullBrLeaseId,
|
|
storageInfo.getStorageID(),
|
|
storageInfo.getStorageID(),
|
|
nodeID);
|
|
nodeID);
|
|
processFirstBlockReport(storageInfo, newReport);
|
|
processFirstBlockReport(storageInfo, newReport);
|
|
@@ -2756,8 +2758,8 @@ public class BlockManager implements BlockStatsMXBean {
|
|
|
|
|
|
if(blockLog.isDebugEnabled()) {
|
|
if(blockLog.isDebugEnabled()) {
|
|
for (Block b : invalidatedBlocks) {
|
|
for (Block b : invalidatedBlocks) {
|
|
- blockLog.debug("BLOCK* processReport 0x{}: {} on node {} size {} " +
|
|
|
|
- "does not belong to any file.", strBlockReportId, b,
|
|
|
|
|
|
+ blockLog.debug("BLOCK* processReport 0x{} with lease ID 0x{}: {} on node {} size {} " +
|
|
|
|
+ "does not belong to any file.", strBlockReportId, fullBrLeaseId, b,
|
|
node, b.getNumBytes());
|
|
node, b.getNumBytes());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2767,9 +2769,9 @@ public class BlockManager implements BlockStatsMXBean {
|
|
if (metrics != null) {
|
|
if (metrics != null) {
|
|
metrics.addStorageBlockReport((int) (endTime - startTime));
|
|
metrics.addStorageBlockReport((int) (endTime - startTime));
|
|
}
|
|
}
|
|
- blockLog.info("BLOCK* processReport 0x{}: from storage {} node {}, " +
|
|
|
|
|
|
+ blockLog.info("BLOCK* processReport 0x{} with lease ID 0x{}: from storage {} node {}, " +
|
|
"blocks: {}, hasStaleStorage: {}, processing time: {} msecs, " +
|
|
"blocks: {}, hasStaleStorage: {}, processing time: {} msecs, " +
|
|
- "invalidatedBlocks: {}", strBlockReportId, storage.getStorageID(),
|
|
|
|
|
|
+ "invalidatedBlocks: {}", strBlockReportId, fullBrLeaseId, storage.getStorageID(),
|
|
nodeID, newReport.getNumberOfBlocks(),
|
|
nodeID, newReport.getNumberOfBlocks(),
|
|
node.hasStaleStorages(), (endTime - startTime),
|
|
node.hasStaleStorages(), (endTime - startTime),
|
|
invalidatedBlocks.size());
|
|
invalidatedBlocks.size());
|