|
[
Permlink
| « Hide
]
Doug Cutting added a comment - 07/Apr/08 07:49 PM
Unless is proves unfeasable, it seems preferable to not add a new RPC protocol, daemon and namenode thread pool, but rather to transmit this in heartbeat responses. Lease recovery does not seem to be performance sensitive.
It seems that option 1 should work fine.
FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) uses Object[] as pass-by-reference parameters. It is better to define a class and use it as the return type. For example,
class HreatbeatResponse {
boolean registration;
Block[] xferBlocks;
DatanodeInfo[][] xferDatanodeInfo;
Block[] deleteList;
}
//the new header would be
HreatbeatResponse FSNamesystem.gotHeartbeat(DatanodeID nodeID,
long capacity,
long dfsUsed,
long remaining,
int xceiverCount,
int xmitsInProgress)
I like the idea of HreatbeatResponse. But it would be better if we change the name to HeartbeatResponse.
1. The namenode asks the primary datanode (through the heartbeat response mechanism) to do a lease recovery. It specifies the blockid in the heartbeat response.
2. The primary datanode receives the blocks for which a lease recovery is needed. It contacts the specified datanode(s) in the pipeline, retrieves blockids and genstamps from them. It then makes a RPC to the namenode specifying the generation stamps of the replicas. The namenode then decides which replicas to keep and which to delete and make necessary midifications to the blocksMap. It also removes the lease associated with the file, thereby indicating the lease recovery is complete. 3. Each datanode has an RPC server. The primary datanode makes an RPC to the secondary datanode(s) in the pipeline to retrieve generation stamp of a block(s). This issue is fixed as a part of
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||