Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-8937

createEphemeralNodeAndWatch don't set watcher if the node is created successfully

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • master

    Description

      CreateEphemeralNodeAndWatch in zkUtil don't set watcher if the node is created successfully. This is not consistent with the comment and may causes the ActiveMasterManager cannot get events that master node is deleted or changed.

        public static boolean createEphemeralNodeAndWatch(ZooKeeperWatcher zkw,
            String znode, byte [] data)
        throws KeeperException {
          try {
            zkw.getRecoverableZooKeeper().create(znode, data, createACL(zkw, znode),
                CreateMode.EPHEMERAL);
          } catch (KeeperException.NodeExistsException nee) {
            if(!watchAndCheckExists(zkw, znode)) {
              // It did exist but now it doesn't, try again
              return createEphemeralNodeAndWatch(zkw, znode, data);
            }
            return false;
          } catch (InterruptedException e) {
            LOG.info("Interrupted", e);
            Thread.currentThread().interrupt();
          }
          return true;
        }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              liushaohui Shaohui Liu
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: