Issue Details (XML | Word | Printable)

Key: HADOOP-725
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Milind Bhandarkar
Reporter: Milind Bhandarkar
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

chooseTargets method in FSNamesystem is very inefficient

Created: 15/Nov/06 11:40 PM   Updated: 08/Jul/09 04:42 PM
Return to search
Component/s: None
Affects Version/s: 0.8.0
Fix Version/s: 0.9.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works chooseTargets.patch 2006-11-16 12:17 AM Milind Bhandarkar 24 kB
Environment: All
Issue Links:
Reference
 

Resolution Date: 20/Nov/06 11:25 PM


 Description  « Hide
Currently the chooseTargets method (that selects datanodes for block-placement) takes in excess of 20% of cpu on a namenode. This is the most time-consuming namenode method, according to the profiler. This inefficiency has already contributed to cascading crash in DFS earlier. As datanodes went down, new locations needed to be found for the blocks on dead datanodes, and since this was done inside a synchronized method, it locked the whole namesystem for several minutes, which caused more datanode failures, when the namenode marked them dead because no heartbeat could be processed during that interval. This has been detailed in HADOOP-572.

The patch I am about to upload reduces the time taken in the chooseTarget method to be proportional to nReplicas per block, instead of the current implementation, which is proportional to (nDataNodes * nReplicas). Also, when a number of datanodes crash, their blocks are put on the pendingReplications list one datanode at a time in a synchronized section. (Currently, the syncchronized section processes ALL the dead datanodes, thus locking the namesystem for a considerable amount of time.) Also, this patch will add a unit test to check replication.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Milind Bhandarkar added a comment - 16/Nov/06 12:17 AM
Patch implementing optimized chooseTargets method in namenode.

Doug Cutting added a comment - 20/Nov/06 11:25 PM
I just committed this. Thanks, Milind!