Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
-
Reviewed
Description
Currently when checking if we should process over-replicated block in addStoredBlock, we count both the number of reported replicas and pending replicas. However, processOverReplicatedBlock chooses excess replicas only among all the reported storages of the block. So in a situation where we have over-replicated replica/internal blocks which only reside in the pending queue, we will not be able to choose any extra replica to delete.
For contiguous blocks, this causes chooseExcessReplicasContiguous to do nothing. But for striped blocks, this may cause endless loop in chooseExcessReplicasStriped in the following while loop:
while (candidates.size() > 1) { List<DatanodeStorageInfo> replicasToDelete = placementPolicy .chooseReplicasToDelete(nonExcess, candidates, (short) 1, excessTypes, null, null);