You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Ruyue Ma (JIRA)" <ji...@apache.org> on 2009/07/20 08:37:14 UTC

[jira] Created: (HDFS-495) Hadoop FSNamesystem startFileInternal() getLease() has bug

Hadoop FSNamesystem startFileInternal() getLease() has bug
----------------------------------------------------------

                 Key: HDFS-495
                 URL: https://issues.apache.org/jira/browse/HDFS-495
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: name-node
    Affects Versions: 0.20.1
            Reporter: Ruyue Ma
            Priority: Minor
             Fix For: 0.20.1


Original Code:

        //
        // If the file is under construction , then it must be in our
        // leases. Find the appropriate lease record.
        //
        Lease lease = leaseManager.getLease(new StringBytesWritable(holder));
        //
        // We found the lease for this file. And surprisingly the original
        // holder is trying to recreate this file. This should never occur.
        //
        if (lease != null) {
          throw new AlreadyBeingCreatedException(
                                                 "failed to create file " + src + " for " + holder +
                                                 " on client " + clientMachine + 
                                                 " because current leaseholder is trying to recreate file.");
        }

Problem: if another client (who has had some file leases) to recreate the underconstruction file, it can't trigger the lease recovery. 
Reason:  we should do:

 if (new StringBytesWritable(holder).equals(pendingFile.clientName)){
          throw new AlreadyBeingCreatedException(
                                                 "failed to create file " + src + " for " + holder +
                                                 " on client " + clientMachine + 
                                                 " because current leaseholder is trying to recreate file.");
}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HDFS-495) Hadoop FSNamesystem startFileInternal() getLease() has bug

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang resolved HDFS-495.
--------------------------------

    Resolution: Duplicate

Thanks Ruyue for taking a look at this issue.

> Hadoop FSNamesystem startFileInternal() getLease() has bug
> ----------------------------------------------------------
>
>                 Key: HDFS-495
>                 URL: https://issues.apache.org/jira/browse/HDFS-495
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.1
>            Reporter: Ruyue Ma
>            Priority: Minor
>             Fix For: 0.20.2
>
>
> Original Code:
>         //
>         // If the file is under construction , then it must be in our
>         // leases. Find the appropriate lease record.
>         //
>         Lease lease = leaseManager.getLease(new StringBytesWritable(holder));
>         //
>         // We found the lease for this file. And surprisingly the original
>         // holder is trying to recreate this file. This should never occur.
>         //
>         if (lease != null) {
>           throw new AlreadyBeingCreatedException(
>                                                  "failed to create file " + src + " for " + holder +
>                                                  " on client " + clientMachine + 
>                                                  " because current leaseholder is trying to recreate file.");
>         }
> Problem: if another client (who has had some file leases) to recreate the underconstruction file, it can't trigger the lease recovery. 
> Reason:  we should do:
>  if (new StringBytesWritable(holder).equals(pendingFile.clientName)){
>           throw new AlreadyBeingCreatedException(
>                                                  "failed to create file " + src + " for " + holder +
>                                                  " on client " + clientMachine + 
>                                                  " because current leaseholder is trying to recreate file.");
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.