hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi Prakash (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7342) Lease Recovery doesn't happen some times
Date Wed, 29 Apr 2015 22:21:09 GMT

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

Ravi Prakash commented on HDFS-7342:

I found another\(?) instance in which the lease is not recovered. This is reproducible easily
on a pseudo-distributed single node cluster
# Before you start it helps if you set. This is not necessary, but simply reduces how long
you have to wait 
  public static final long LEASE_SOFTLIMIT_PERIOD = 30 * 1000;
# Client starts to write a file. (could be less than 1 block, but it hflushed so some of the
data has landed on the datanodes) (I'm copying the client code I am using. I generate a jar
and run it using $ hadoop jar TestHadoop.jar)
# Client crashes. (I simulate this by kill -9 the $(hadoop jar TestHadoop.jar) process after
it has printed "Wrote to the bufferedWriter"
# Shoot the datanode. (Since I ran on a pseudo-distributed cluster, there was only 1)

I believe the lease should be recovered and the block should be marked missing. However this
is not happening. The lease is never recovered. I am going to check what happens when only
the primary datanode is shot. {color:red}Please let me know if I shouldn't hijack this JIRA.
By default I will{color}

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

public class TestHadoop {
  public static void main(String args[]) throws IOException, InterruptedException {
    Path path = new Path("/tmp/testHadoop");
    Configuration conf = new Configuration();
    FileSystem fs = FileSystem.get(conf);
    System.out.println("DefaultFS: " + conf.get("fs.defaultFS"));
    FSDataOutputStream hdfsout = fs.create(path,true);
    BufferedWriter br=new BufferedWriter(new OutputStreamWriter(hdfsout));
    System.out.println("Created the bufferedWriter" );
    br.write("Some string");
    System.out.println("Wrote to the bufferedWriter" );
    Thread.sleep(120000); //KILL THE PROCESS DURING THIS SLEEP
    System.out.println("Closed the bufferedWriter" );

> Lease Recovery doesn't happen some times
> ----------------------------------------
>                 Key: HDFS-7342
>                 URL: https://issues.apache.org/jira/browse/HDFS-7342
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.0.0-alpha
>            Reporter: Ravi Prakash
>         Attachments: HDFS-7342.1.patch, HDFS-7342.2.patch, HDFS-7342.3.patch
> In some cases, LeaseManager tries to recover a lease, but is not able to. HDFS-4882 describes
a possibility of that. We should fix this

This message was sent by Atlassian JIRA

View raw message