[ 
https://issues.apache.org/jira/browse/HDFS-8578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14591256#comment-14591256
 ] 

Vinayakumar B commented on HDFS-8578:
-------------------------------------

bq. OK, so your idea is that that will allow us to parallelize upgrades between 
different block pools. Fair enough.
Not exactly. {{DataStorage#addStorageLocations(..)}} is called per blockpool 
only. And two different blockpools initialization is synchronized in 
Datanode.java itself. {code}synchronized (this) {
        storage.recoverTransitionRead(this, nsInfo, dataDirs, startOpt);
      }{code}

My change was because for the same blockpool, each directory is being loaded 
separately in .  {{DataStorage#addStorageLocations(..)}}. 
{code}List<File> bpDataDirs = new ArrayList<File>();
      bpDataDirs.add(BlockPoolSliceStorage.getBpRoot(bpid, new File(root,
              STORAGE_DIR_CURRENT)));
...
...
bpStorage.recoverTransitionRead(datanode, nsInfo, bpDataDirs, startOpt);
{code}
So in {{BlockPoolSliceStorage#loadBpStorageDirectories(... Collection<File> 
dataDirs, ...)}}, {{dataDirs}} will have only one directory during startup. So 
adding parallelism there will not change anything.

bq. I don't think this is true. The DN will not start up if more than 
dfs.datanode.failed.volumes.tolerated volumes have failed, as per this code: 
Yes!! You are right. I just checked only 
{{DataStorage#addStorageLocations(..)}}, had totally forgot about 
{{dfs.datanode.failed.volumes.tolerated}}.

> On upgrade, Datanode should process all storage/data dirs in parallel
> ---------------------------------------------------------------------
>
>                 Key: HDFS-8578
>                 URL: https://issues.apache.org/jira/browse/HDFS-8578
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>            Reporter: Raju Bairishetti
>            Priority: Critical
>         Attachments: HDFS-8578-01.patch, HDFS-8578-02.patch
>
>
> Right now, during upgrades datanode is processing all the storage dirs 
> sequentially. Assume it takes ~20 mins to process a single storage dir then  
> datanode which has ~10 disks will take around 3hours to come up.
> *BlockPoolSliceStorage.java*
> {code}
>    for (int idx = 0; idx < getNumStorageDirs(); idx++) {
>       doTransition(datanode, getStorageDir(idx), nsInfo, startOpt);
>       assert getCTime() == nsInfo.getCTime() 
>           : "Data-node and name-node CTimes must be the same.";
>     }
> {code}
> It would save lots of time during major upgrades if datanode process all 
> storagedirs/disks parallelly.
> Can we make datanode to process all storage dirs parallelly?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to