hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Wang (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HDFS-6223) Using the command setrep to set the replication factor more than the number of datanodes with the -w parameter, the command gets in a infinite loop.
Date Tue, 22 Apr 2014 23:06:17 GMT

     [ https://issues.apache.org/jira/browse/HDFS-6223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrew Wang resolved HDFS-6223.
-------------------------------

    Resolution: Not a Problem

I agree with [~sureshms] on the behavior of the -w flag with setrep, so will resolve this
for now. [~jinghuiyin], please reopen if you disagree.

> Using the command setrep to set the replication factor more than the number of datanodes
with the -w parameter, the command gets in a infinite loop.
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-6223
>                 URL: https://issues.apache.org/jira/browse/HDFS-6223
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs-client
>    Affects Versions: 2.1.1-beta, 2.2.0, 2.3.0
>            Reporter: Jinghui Wang
>            Assignee: Jinghui Wang
>
> Using the command setrep to set the replication factor more than the number of datanodes
with the -w parameter gets in a infinite loop. When the -w parameter is there, the command
gets in the following code to wait for the replication factor to be met before exiting. But
if the number of datanodes is less than the desired replication factor, the exiting condition
is never met. 
> A proposed fix is to add a timeout parameter, so the command will wait for a certain
amount of time or number of tries before exiting. 
>   for(boolean done = false; !done; ) {
>         BlockLocation[] locations = fs.getFileBlockLocations(status, 0, len);
>         int i = 0;
>         for(; i < locations.length && 
>           locations[i].getHosts().length == rep; i++)
>           if (!printWarning && locations[i].getHosts().length > rep) {
>             System.out.println("\nWARNING: the waiting time may be long for "
>                 + "DECREASING the number of replication.");
>             printWarning = true;
>           }
>         done = i == locations.length;
>         if (!done) {
>           System.out.print(".");
>           System.out.flush();
>           try {Thread.sleep(10000);} catch (InterruptedException e) {}
>         }
>       }



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message