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
- is duplicated by
-
HBASE-10448 ZKUtil create and watch methods don't set watch in some cases
- Closed