Skip to content

Commit ac471d7

Browse files
authored
HDFS-17339:Skip cacheReport when one blockPool does not have CacheBlock on this DataNode (#6456). Contributed by lei w.
Signed-off-by: Shuyan Zhang <zhangshuyan@apache.org>
1 parent 7272a3d commit ac471d7

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
@@ -503,6 +503,10 @@ DatanodeCommand cacheReport() throws IOException {
503503

504504
String bpid = bpos.getBlockPoolId();
505505
List<Long> blockIds = dn.getFSDataset().getCacheReport(bpid);
506+
// Skip cache report
507+
if (blockIds.isEmpty()) {
508+
return null;
509+
}
506510
long createTime = monotonicNow();
507511

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

0 commit comments

Comments
 (0)