diff --git a/CHANGES.txt b/CHANGES.txt index 86f21a36e5c..119e77337ad 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -382,6 +382,7 @@ Release 0.21.0 - Unreleased HBASE-2241 Change balancer sloppyness from 0.1 to 0.3 HBASE-2250 typo in the maven pom HBASE-2254 Improvements to the Maven POMs (Lars Francke via Stack) + HBASE-2262 ZKW.ensureExists should check for existence NEW FEATURES HBASE-1961 HBase EC2 scripts diff --git a/core/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java b/core/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java index 0a05dbd3e5d..88307601265 100644 --- a/core/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java +++ b/core/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java @@ -398,6 +398,10 @@ public class ZooKeeperWrapper implements HConstants { private boolean ensureExists(final String znode) { try { + Stat stat = zooKeeper.exists(znode, false); + if (stat != null) { + return true; + } zooKeeper.create(znode, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); LOG.debug("Created ZNode " + znode);