Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
Block replication policy tends to balance the number of blocks in each datanode in the long run, however with heterogeneous clusters with varying number of disks per node, the nodes with one disk fill quickly while nodes with 3 disks still have 60% free disk space. This also reduces the advantage of using more than one disk for parallel IO, since machines with multiple disks are not used as much.
The javadoc of the ReplicationTargetChooser reads as :
The replica placement strategy is that if the writer is on a datanode, the 1st replica is placed on the local machine, otherwise a random datanode. The 2nd replica is placed on a datanode that is on a different rack. The 3rd replica is placed on a datanode which is on the same rack as the first replica.
I think we should switch to a policy that balances the percent of disk usage rather than balancing total block count among the datanodes. This can be done by defining the probability of selection of a datanode based on its disk percent usage. A formula like 1 - (percent_usage / 100 ) seems reasonable.
Attachments
Issue Links
- is related to
-
HDFS-4113 When adding datanodes with less disk capacity to an existing cluster, the new DNs fill up faster and subsequently cause errors during put operations
- Open