Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-3399 BookKeeper option support for NN HA
  3. HDFS-3386

BK JM : Namenode is not deleting his lock entry '/ledgers/lock/lock-0000X', when fails to acquire the lock

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 2.0.0-alpha, 3.0.0-alpha1
    • None
    • ha
    • None

    Description

      When a Standby NN becomes Active, it will first create his sequential lock entry create lock-000X in ZK and then tries to acquire the lock as shown below:

      myznode = zkc.create(lockpath + "/lock-", new byte[]

      Unknown macro: {'0'}

      ,
      Ids.OPEN_ACL_UNSAFE,
      CreateMode.EPHEMERAL_SEQUENTIAL);
      if ((lockpath + "/" + nodes.get(0)).equals(myznode)) {
      if (LOG.isTraceEnabled())

      Unknown macro: { LOG.trace("Lock acquired - " + myznode); }

      lockCount.set(1);
      zkc.exists(myznode, this);
      return;
      } else

      Unknown macro: { LOG.error("Failed to acquire lock with " + myznode + ", " + nodes.get(0) + " already has it"); throw new IOException("Could not acquire lock"); }

      Say the transition to standby fails to acquire the lock it will throw the exception and NN is getting shutdown. Here the problem is, the lock entry lock-000X will exists in the ZK till session expiry and the further start-up will not be able to acquire lock.

      Attachments

        1. HDFS-3386.diff
          4 kB
          Ivan Kelly

        Issue Links

          Activity

            People

              ikelly Ivan Kelly
              surendralilhore Surendra Singh Lilhore
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: