Why 10th heartbeat is necessary to send block report?


2 Answer(s)


hi Santosh,

NameNode creates an internal structure of Block to file level mapping, block to datanode mapping and datanode to RAC mapping. As part of the block report, DN's send what blocks are there, how many are corrupted, how many are over/under replicated. Based on this block report information, NameNode will build the above mapping in fsimage. When clients request for a specificl file, NN will look into the fsimage (mapping) and give the path/DN to the client.

"As part of the block report, DN's send what blocks are there, how many are corrupted, how many are over/under replicated. " 

How would a datanode know if a given block is under/ over replicated ? that info should be with the Namenode since it knows what file a block belongs to and replication factor , so if it doesn't have the replicas per the stated replication factor it will mark the blcoks under/over/miss replicated accordingly