meatballspaghetti commented on code in PR #4996:
URL: https://github.com/apache/accumulo/pull/4996#discussion_r1826127429


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/Namespaces.java:
##########
@@ -42,7 +38,8 @@ public class Namespaces {
 
   public static boolean exists(ClientContext context, NamespaceId namespaceId) 
{
     ZooCache zc = context.getZooCache();
-    List<String> namespaceIds = zc.getChildren(context.getZooKeeperRoot() + 
Constants.ZNAMESPACES);
+    List<String> namespaceIds = new ArrayList<>(NamespaceMapping

Review Comment:
   Updated.



##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader11to12.java:
##########
@@ -117,6 +122,28 @@ public void upgradeZookeeper(@NonNull ServerContext 
context) {
         zrw.overwritePersistentData(rootBase, rtm.toJson().getBytes(UTF_8), 
stat.getVersion());
         log.info("Root metadata in ZooKeeper after upgrade: {}", rtm.toJson());
       }
+
+      String zPath = Constants.ZROOT + "/" + context.getInstanceID() + 
Constants.ZNAMESPACES;
+      byte[] existingMapData = zrw.getData(zPath);
+      List<String> namespaceIdList = zrw.getChildren(zPath);
+      Map<String,String> namespaceMap = null;
+      if (existingMapData != null) {
+        namespaceMap = NamespaceMapping.deserialize(existingMapData);
+      }
+      if (namespaceMap == null || namespaceMap.isEmpty()) {

Review Comment:
   Updated to a simpler check. Now checks if namespaces node has an empty byte 
array, which should always be expected. If unexpected data is under the 
namespaces node, then exception is thrown.



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