This is an automated email from the ASF dual-hosted git repository.
tasanuma pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new 75af1d6 HDFS-16375. The FBR lease ID should be exposed to the log
(#3769)
75af1d6 is described below
commit 75af1d67e4190277d01a599b11a20f9281e538fe
Author: litao <[email protected]>
AuthorDate: Thu Dec 16 12:29:32 2021 +0800
HDFS-16375. The FBR lease ID should be exposed to the log (#3769)
(cherry picked from commit 10cdde59b4666e7f70e0788409ca7b214539cedb)
---
.../hdfs/server/blockmanagement/BlockManager.java | 18 ++++++++++--------
.../hadoop/hdfs/server/datanode/BPServiceActor.java | 4 ++--
2 files changed, 12 insertions(+), 10 deletions(-)
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 97cb313..240f2e2 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
@@ -2702,6 +2702,8 @@ public class BlockManager implements BlockStatsMXBean {
Collection<Block> invalidatedBlocks = Collections.emptyList();
String strBlockReportId =
context != null ? Long.toHexString(context.getReportId()) : "";
+ String fullBrLeaseId =
+ context != null ? Long.toHexString(context.getLeaseId()) : "";
try {
node = datanodeManager.getDatanode(nodeID);
@@ -2724,10 +2726,10 @@ public class BlockManager implements BlockStatsMXBean {
if (namesystem.isInStartupSafeMode()
&& !StorageType.PROVIDED.equals(storageInfo.getStorageType())
&& storageInfo.getBlockReportCount() > 0) {
- blockLog.info("BLOCK* processReport 0x{}: "
+ blockLog.info("BLOCK* processReport 0x{} with lease ID 0x{}: "
+ "discarded non-initial block report from {}"
+ " because namenode still in startup phase",
- strBlockReportId, nodeID);
+ strBlockReportId, fullBrLeaseId, nodeID);
blockReportLeaseManager.removeLease(node);
return !node.hasStaleStorages();
}
@@ -2735,9 +2737,9 @@ public class BlockManager implements BlockStatsMXBean {
if (storageInfo.getBlockReportCount() == 0) {
// The first block report can be processed a lot more efficiently than
// 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 {}",
- strBlockReportId,
+ strBlockReportId, fullBrLeaseId,
storageInfo.getStorageID(),
nodeID);
processFirstBlockReport(storageInfo, newReport);
@@ -2756,8 +2758,8 @@ public class BlockManager implements BlockStatsMXBean {
if(blockLog.isDebugEnabled()) {
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());
}
}
@@ -2767,9 +2769,9 @@ public class BlockManager implements BlockStatsMXBean {
if (metrics != null) {
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, " +
- "invalidatedBlocks: {}", strBlockReportId, storage.getStorageID(),
+ "invalidatedBlocks: {}", strBlockReportId, fullBrLeaseId,
storage.getStorageID(),
nodeID, newReport.getNumberOfBlocks(),
node.hasStaleStorages(), (endTime - startTime),
invalidatedBlocks.size());
diff --git
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
index a5139b6..a8c8962 100755
---
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
+++
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
@@ -435,8 +435,8 @@ class BPServiceActor implements Runnable {
dn.getMetrics().addBlockReport(brSendCost, getRpcMetricSuffix());
final int nCmds = cmds.size();
LOG.info((success ? "S" : "Uns") +
- "uccessfully sent block report 0x" +
- Long.toHexString(reportId) + " to namenode: " + nnAddr +
+ "uccessfully sent block report 0x" + Long.toHexString(reportId) +
+ " with lease ID 0x" + Long.toHexString(fullBrLeaseId) + " to
namenode: " + nnAddr +
", containing " + reports.length +
" storage report(s), of which we sent " + numReportsSent + "." +
" The reports had " + totalBlockCount +
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]