This is an automated email from the ASF dual-hosted git repository.

hulee pushed a commit to branch zooscalability
in repository https://gitbox.apache.org/repos/asf/helix.git

commit 388d0c0fbf2761443c7358bfded28b1bcefe9e2f
Author: Neal Sun <[email protected]>
AuthorDate: Wed Feb 26 17:24:22 2020 -0800

    Fix InvalidRoutingData error message in tests (#821)
    
    
    This PR aims to fix the InvalidRoutingDataException error message that 
shows up in tests. The source of this error was due to two test cases in 
TestZkMetadataStoreDirectory, in which both of the test cases inserted 
"/a/b/c/d/e" directly into the same set of routing data. This renders the 
routing data invalid because one sharding key is pointing to two realms.
    This was not caught at insertion because the insertion was done directly 
instead of through a dedicated API (because the code in question is a test 
case). The tests didn't fail because they relied on the raw routing data for 
correctness. The construction of MetadataStoreRoutingData failed "correctly" as 
can be seen from the error messages, however the construction failure was after 
raw routing data being fetched, therefore making the situation undetected.
---
 .../apache/helix/rest/metadatastore/TestZkMetadataStoreDirectory.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/helix-rest/src/test/java/org/apache/helix/rest/metadatastore/TestZkMetadataStoreDirectory.java
 
b/helix-rest/src/test/java/org/apache/helix/rest/metadatastore/TestZkMetadataStoreDirectory.java
index 6fe5f32..00a328f 100644
--- 
a/helix-rest/src/test/java/org/apache/helix/rest/metadatastore/TestZkMetadataStoreDirectory.java
+++ 
b/helix-rest/src/test/java/org/apache/helix/rest/metadatastore/TestZkMetadataStoreDirectory.java
@@ -253,7 +253,7 @@ public class TestZkMetadataStoreDirectory extends 
AbstractTestClass {
     // Since there was a child change callback, make sure data change works on 
the new child (realm) as well by adding a key
     // This tests removing all subscriptions and subscribing with new children 
list
     // For all namespaces (Routing ZKs), add an extra sharding key to 
TEST_REALM_3
-    String newKey = "/a/b/c/d/e";
+    String newKey = "/x/y/z";
     _zkList.forEach(zk -> {
       ZNRecord znRecord = ZK_SERVER_MAP.get(zk).getZkClient()
           .readData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + 
TEST_REALM_3);

Reply via email to