Why 10th heartbeat is necessary to send block report?



0
Name node has every block information as it is the one which directs to the datanode for writing the blocks, then why do DN needs to send the block report? does it cross checks with name node or any other purpose?

2 Answer(s)


0

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.

0

"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