Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-495

Hadoop FSNamesystem startFileInternal() getLease() has bug

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 0.20.1
    • Fix Version/s: 0.20.2
    • Component/s: namenode
    • Labels:
      None

      Description

      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."); }
      1. HDFS-495.patch
        4 kB
        Konstantin Shvachko

        Issue Links

          Activity

          Hide
          Konstantin Shvachko added a comment -

          Fixing the problem for y20, since everything else is already fixed.

          Show
          Konstantin Shvachko added a comment - Fixing the problem for y20, since everything else is already fixed.
          Hide
          Hairong Kuang added a comment -

          Thanks Ruyue for taking a look at this issue.

          Show
          Hairong Kuang added a comment - Thanks Ruyue for taking a look at this issue.
          Hide
          Ruyue Ma added a comment -

          This bug has been fixed in the latest trunk. we should cancel the issue.

          Show
          Ruyue Ma added a comment - This bug has been fixed in the latest trunk. we should cancel the issue.
          Hide
          Ruyue Ma added a comment -

          Sorry, I see this just now.

          I will give the patch next week.

          Show
          Ruyue Ma added a comment - Sorry, I see this just now. I will give the patch next week.
          Hide
          dhruba borthakur added a comment -

          Is it possible for you to post this patch and a unit test (instead of waiting for HDFS-200)? Thanks. Here is a page that describes how to write unit tests : http://wiki.apache.org/hadoop/HowToContribute

          Show
          dhruba borthakur added a comment - Is it possible for you to post this patch and a unit test (instead of waiting for HDFS-200 )? Thanks. Here is a page that describes how to write unit tests : http://wiki.apache.org/hadoop/HowToContribute
          Hide
          dhruba borthakur added a comment -

          Absolutely right. This fix is posted as part of patch attached to HDFS-200

          Show
          dhruba borthakur added a comment - Absolutely right. This fix is posted as part of patch attached to HDFS-200

            People

            • Assignee:
              Unassigned
              Reporter:
              Ruyue Ma
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Development