Apache9 commented on a change in pull request #2652:
URL: https://github.com/apache/hbase/pull/2652#discussion_r522733824



##########
File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestZKConnectionRegistry.java
##########
@@ -125,4 +127,20 @@ public void testNoMetaAvailable() throws 
InterruptedException {
       }
     }
   }
+
+  /**
+   * Pass discontinuous list of znodes to registry getMetaRegionLocation. 
Should work fine.
+   * It used to throw ArrayOutOfBoundsException. See HBASE-25280.
+   */
+  @Test
+  public void testDiscontinuousLocations() throws ExecutionException, 
InterruptedException {
+    Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
+    try (ZKConnectionRegistry registry = new ZKConnectionRegistry(conf)) {
+      CompletableFuture<RegionLocations> cf = new CompletableFuture<>();
+      List<String> znodes = Arrays.asList(
+        new String[] { ZNodePaths.META_ZNODE_PREFIX, 
ZNodePaths.META_ZNODE_PREFIX + "_003" });
+      registry.getMetaRegionLocation(cf, znodes);

Review comment:
       Better to not expose this method here but write fake znode on zk to 
simulate discontinuous meta replicas? I do not think it is very difficult to 
do...




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to