You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/02/20 04:31:03 UTC

[GitHub] sijie closed pull request #1171: Enforce zkAcls on initNewCluster

sijie closed pull request #1171: Enforce zkAcls on initNewCluster
URL: https://github.com/apache/bookkeeper/pull/1171
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationManager.java
index b82f406d1..ee3f3cf9b 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationManager.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/discover/ZKRegistrationManager.java
@@ -73,7 +73,6 @@
 import org.apache.zookeeper.Watcher.Event.EventType;
 import org.apache.zookeeper.Watcher.Event.KeeperState;
 import org.apache.zookeeper.ZKUtil;
-import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Stat;
@@ -485,10 +484,10 @@ public boolean initNewCluster() throws Exception {
         }
 
         // Create ledgers root node
-        zk.create(zkLedgersRootPath, "".getBytes(UTF_8), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+        zk.create(zkLedgersRootPath, "".getBytes(UTF_8), zkAcls, CreateMode.PERSISTENT);
 
         // create available bookies node
-        zk.create(zkAvailableBookiesPath, "".getBytes(UTF_8), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+        zk.create(zkAvailableBookiesPath, "".getBytes(UTF_8), zkAcls, CreateMode.PERSISTENT);
 
         // creates the new layout and stores in zookeeper
         LedgerManagerFactory.newLedgerManagerFactory(conf, layoutManager);
@@ -496,7 +495,7 @@ public boolean initNewCluster() throws Exception {
         // create INSTANCEID
         String instanceId = UUID.randomUUID().toString();
         zk.create(conf.getZkLedgersRootPath() + "/" + BookKeeperConstants.INSTANCEID, instanceId.getBytes(UTF_8),
-                Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+                zkAcls, CreateMode.PERSISTENT);
 
         log.info("Successfully initiated cluster. ZKServers: {} ledger root path: {} instanceId: {}", zkServers,
                 zkLedgersRootPath, instanceId);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services