EdColeman commented on code in PR #2569:
URL: https://github.com/apache/accumulo/pull/2569#discussion_r869672162


##########
server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java:
##########
@@ -62,23 +63,36 @@ public class TableManager {
   private final String zkRoot;
   private final InstanceId instanceID;
   private final ZooReaderWriter zoo;
-  private ZooCache zooStateCache;
+  private final ZooCache zooStateCache;
 
-  public static void prepareNewNamespaceState(ZooReaderWriter zoo, InstanceId 
instanceId,
-      NamespaceId namespaceId, String namespace, NodeExistsPolicy existsPolicy)
-      throws KeeperException, InterruptedException {
+  public static void prepareNewNamespaceState(ZooReaderWriter zoo, final 
PropStore 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;
 
     zoo.putPersistentData(zPath, new byte[0], existsPolicy);
     zoo.putPersistentData(zPath + Constants.ZNAMESPACE_NAME, 
namespace.getBytes(UTF_8),
         existsPolicy);
     zoo.putPersistentData(zPath + Constants.ZNAMESPACE_CONF, new byte[0], 
existsPolicy);
+
+    PropCacheKey propKey = PropCacheKey.forNamespace(instanceId, namespaceId);
+    if (!propStore.exists(propKey)) {
+      propStore.create(propKey, Map.of());

Review Comment:
   Currently if multiple writers try to do a create one will succeed the others 
will fail - but there will only be one created and the exception of a duplicate 
node will be propagated



-- 
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