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>
This commit is contained in:
Lei313 2024-01-25 21:15:20 +08:00 committed by GitHub
parent 7272a3d960
commit ac471d7daa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -503,6 +503,10 @@ DatanodeCommand cacheReport() throws IOException {
String bpid = bpos.getBlockPoolId();
List<Long> blockIds = dn.getFSDataset().getCacheReport(bpid);
// Skip cache report
if (blockIds.isEmpty()) {
return null;
}
long createTime = monotonicNow();
cmd = bpNamenode.cacheReport(bpRegistration, bpid, blockIds);