Support Questions

Find answers, ask questions, and share your expertise

Data Node recovery after a day while under replicated blocks are still replicating

avatar
Contributor

I have 5 Data nodes, where 1 Data node crashed. Name node is still replicating the data blocks of the crashed Data node. What happens when I recover the crashed Data node. The data blocks which is under replicated will be reported but what happens to already replicated blocks. Will they be marked as corrupted blocks or will be deleted/removed since there will be 4 replicas?

1 ACCEPTED SOLUTION

avatar
Contributor

Hello @pauljoshiva


The NameNode endeavors to ensure that each block always has the intended number of replicas. The NameNode detects that a block has become under- or over-replicated when a block report from a DataNode arrives. When a block becomes over replicated, the NameNode chooses a replica to remove. The NameNode will prefer not to reduce the number of racks that host replicas, and secondly prefer to remove a replica from the DataNode with the least amount of available disk space. The goal is to balance storage utilization across DataNodes without reducing the block's availability.

 

Hope this answers your query. 

 

 

Regards,

Manoj

View solution in original post

2 REPLIES 2

avatar
Expert Contributor

Hello @pauljoshiva 

 

If the crashed data node comes up, then the data replica count will be 4 that is the case of over replicated blocks.HDFS will automatically delete the excess replicas as the default replication factor has to be maintained 3. The replica from the now active datanode is going to be removed.

 

https://docs.cloudera.com/runtime/7.2.9/hdfs-overview/topics/hdfs-how-namenode-manages-blocks-on-a-f...

avatar
Contributor

Hello @pauljoshiva


The NameNode endeavors to ensure that each block always has the intended number of replicas. The NameNode detects that a block has become under- or over-replicated when a block report from a DataNode arrives. When a block becomes over replicated, the NameNode chooses a replica to remove. The NameNode will prefer not to reduce the number of racks that host replicas, and secondly prefer to remove a replica from the DataNode with the least amount of available disk space. The goal is to balance storage utilization across DataNodes without reducing the block's availability.

 

Hope this answers your query. 

 

 

Regards,

Manoj