keith-turner commented on code in PR #4996:
URL: https://github.com/apache/accumulo/pull/4996#discussion_r1816800436


##########
server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java:
##########
@@ -71,11 +72,11 @@ public static void prepareNewNamespaceState(ZooReaderWriter 
zoo, final PropStore
       InstanceId instanceId, NamespaceId namespaceId, String namespace,
       NodeExistsPolicy existsPolicy) throws KeeperException, 
InterruptedException {
     log.debug("Creating ZooKeeper entries for new namespace {} (ID: {})", 
namespace, namespaceId);
-    String zPath = Constants.ZROOT + "/" + instanceId + Constants.ZNAMESPACES 
+ "/" + namespaceId;
+    String zPath = Constants.ZROOT + "/" + instanceId + Constants.ZNAMESPACES;
 
-    zoo.putPersistentData(zPath, new byte[0], existsPolicy);
-    zoo.putPersistentData(zPath + Constants.ZNAMESPACE_NAME, 
namespace.getBytes(UTF_8),
-        existsPolicy);
+    zoo.putPersistentData(zPath + "/" + namespaceId, new byte[0], 
existsPolicy);
+    zoo.putPersistentData(zPath,
+        NamespaceMapping.writeNamespaceToMap(zoo, zPath, namespaceId, 
namespace), existsPolicy);

Review Comment:
   > @keith-turner I think this method is only ever called during the init 
code, which is in a single thread
   
   It is also called by PopulateZookeeperWithNamespace which is part of the 
create namespace code and could call the code concurrently.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to