Skip to content

Commit 243af8b

Browse files
freedomLei313
authored andcommitted
HDFS-17339:Skip cacheReport when one blockPool does not have CacheBlock on this DataNode
1 parent 99a59ae commit 243af8b

File tree

1 file changed

+4
-0
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode

1 file changed

+4
-0
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,10 @@ DatanodeCommand cacheReport() throws IOException {
514514

515515
String bpid = bpos.getBlockPoolId();
516516
List<Long> blockIds = dn.getFSDataset().getCacheReport(bpid);
517+
// Skip cache report
518+
if (blockIds.isEmpty()) {
519+
return null;
520+
}
517521
long createTime = monotonicNow();
518522

519523
cmd = bpNamenode.cacheReport(bpRegistration, bpid, blockIds);

0 commit comments

Comments
 (0)