Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -652,24 +652,27 @@ private void scanDatanodeStorage(DatanodeDescriptor dn,
Iterator<BlockInfo> it = s.getBlockIterator();
while (it.hasNext()) {
BlockInfo b = it.next();
if (!initialScan || dn.isEnteringMaintenance()) {
// this is a rescan, so most blocks should be replicated now,
// or this node is going into maintenance. On a healthy
// cluster using racks or upgrade domain, a node should be
// able to go into maintenance without replicating many blocks
// so we will check them immediately.
if (!isBlockReplicatedOk(dn, b, false, null)) {
blockList.put(b, null);
}
} else {
blockList.put(b, null);
}
blockList.put(b, null);
numBlocksChecked++;
}
} finally {
namesystem.readUnlock();
}
}
if (!initialScan || dn.isEnteringMaintenance()) {
// this is a rescan, so most blocks should be replicated now,
// or this node is going into maintenance. On a healthy
// cluster using racks or upgrade domain, a node should be
// able to go into maintenance without replicating many blocks
// so we will check them immediately.
Iterator<BlockInfo> iterator = blockList.keySet().iterator();
while(iterator.hasNext()) {
BlockInfo b = iterator.next();
if (isBlockReplicatedOk(dn, b, false, null)) {
iterator.remove();
}
}
}
}

/**
Expand Down