You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "desaikomal (via GitHub)" <gi...@apache.org> on 2023/05/24 06:53:56 UTC

[GitHub] [helix] desaikomal opened a new pull request, #2505: Replace deprecated verifier with new set of Verifiers

desaikomal opened a new pull request, #2505:
URL: https://github.com/apache/helix/pull/2505

   ### Issues
   
   - [X] My PR addresses the following Helix issues and references them in the PR description:
   Fixes #2485 
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI changes:
   While debugging the failure for the test case in DistributedController test case, realized we are using deprecated verifier. So let us first use the right verifier and see if it helps with resolving the temporary failures. These are all integration tests which depends on ZK timing and so not sure if just replacing correct verifier will help. But first order problem is to use right code.
   
   
   ### Tests
   
   - [] The following tests are written for this issue:
   
   (List the names of added unit/integration tests)
   
   - The following is the result of the "mvn test" command on the appropriate module:
   I created a branch and ran the test 4 times to make sure that there is no regression with using different verifier.
   Here is the link to the branch with testing:
   https://github.com/desaikomal/helix/pull/2
   - failure were in different test cases.
   
   ### Changes that Break Backward Compatibility (Optional)
   
   - My PR contains changes that break backward compatibility or previous assumptions for certain methods or API. They include:
   
   (Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)
   
   ### Documentation (Optional)
   
   - In case of new functionality, my PR adds documentation in the following wiki page:
   
   (Link the GitHub wiki you added)
   
   ### Commits
   
   - My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Code Quality
   
   - My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)
   


-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] parakhnr commented on a diff in pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "parakhnr (via GitHub)" <gi...@apache.org>.
parakhnr commented on code in PR #2505:
URL: https://github.com/apache/helix/pull/2505#discussion_r1205772209


##########
helix-core/src/test/java/org/apache/helix/integration/manager/TestDistributedControllerManager.java:
##########
@@ -82,8 +82,9 @@ public void simpleIntegrationTest() throws Exception {
     distributedControllers[0].disconnect();
 
     // verify leader changes to localhost_12919
-    Thread.sleep(100);
-    result = verifier.verifyByZkCallback();
+    result = TestHelper.verify(() -> {
+      return verifier.verifyByZkCallback();
+    }, 100);

Review Comment:
   Actually 100, won't help much, the verify method does the following:
   1. Record startTime = currentTime
   2. Invoke verifier.verifyByZkCallback()
       2.1 Wait for max 30 seconds(default timeout) for the state to be verified
   3.  If currentTime - startTime > 100 repeat 1.
   
   So I think we need to have time out > (30 seconds + some buffer) if we want the verification to be retried. If we don't want the verification to be retried(which is the current implementation), then we need to use `verifier.verifyByZkCallback(30seconds default timeout + 100 milliseconds)` instead of `verifier.verifyByZkCallback()`. 
   
   Apologies for the previous comment as I didn't read through the `TestHelper.verify` method code.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu merged pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "xyuanlu (via GitHub)" <gi...@apache.org>.
xyuanlu merged PR #2505:
URL: https://github.com/apache/helix/pull/2505


-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] desaikomal commented on a diff in pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "desaikomal (via GitHub)" <gi...@apache.org>.
desaikomal commented on code in PR #2505:
URL: https://github.com/apache/helix/pull/2505#discussion_r1205787446


##########
helix-core/src/test/java/org/apache/helix/integration/manager/TestDistributedControllerManager.java:
##########
@@ -82,8 +82,9 @@ public void simpleIntegrationTest() throws Exception {
     distributedControllers[0].disconnect();
 
     // verify leader changes to localhost_12919
-    Thread.sleep(100);
-    result = verifier.verifyByZkCallback();
+    result = TestHelper.verify(() -> {
+      return verifier.verifyByZkCallback();
+    }, 100);

Review Comment:
   I think, i don't need it re=tried as earlier code just did sleep and moved on. 
   This is also the reason, I like to stick to the scope of the change to be what I set out with.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] parakhnr commented on a diff in pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "parakhnr (via GitHub)" <gi...@apache.org>.
parakhnr commented on code in PR #2505:
URL: https://github.com/apache/helix/pull/2505#discussion_r1205789813


##########
helix-core/src/test/java/org/apache/helix/integration/manager/TestDistributedControllerManager.java:
##########
@@ -82,8 +82,9 @@ public void simpleIntegrationTest() throws Exception {
     distributedControllers[0].disconnect();
 
     // verify leader changes to localhost_12919
-    Thread.sleep(100);
-    result = verifier.verifyByZkCallback();
+    result = TestHelper.verify(() -> {
+      return verifier.verifyByZkCallback();
+    }, 100);

Review Comment:
   Ok. Lets stick to original one or use callback with timeout that has 30 seconds + 100 milliseconds set. 



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] desaikomal commented on a diff in pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "desaikomal (via GitHub)" <gi...@apache.org>.
desaikomal commented on code in PR #2505:
URL: https://github.com/apache/helix/pull/2505#discussion_r1204829976


##########
helix-core/src/test/java/org/apache/helix/integration/manager/TestDistributedControllerManager.java:
##########
@@ -71,18 +72,18 @@ public void simpleIntegrationTest() throws Exception {
           new MockMSModelFactory());
       distributedControllers[i].connect();
     }
+    BestPossibleExternalViewVerifier verifier = new BestPossibleExternalViewVerifier
+        .Builder(clusterName).setZkAddress(ZK_ADDR).build();
 
-    boolean result = ClusterStateVerifier
-        .verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR, clusterName));
+    boolean result = verifier.verifyByZkCallback();
     Assert.assertTrue(result);
 
     // disconnect first distributed-controller, and verify second takes leadership
     distributedControllers[0].disconnect();
 
     // verify leader changes to localhost_12919
     Thread.sleep(100);

Review Comment:
   @parakhnr - can you please review one more time?



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] desaikomal commented on a diff in pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "desaikomal (via GitHub)" <gi...@apache.org>.
desaikomal commented on code in PR #2505:
URL: https://github.com/apache/helix/pull/2505#discussion_r1204589618


##########
helix-core/src/test/java/org/apache/helix/integration/manager/TestDistributedControllerManager.java:
##########
@@ -71,18 +72,18 @@ public void simpleIntegrationTest() throws Exception {
           new MockMSModelFactory());
       distributedControllers[i].connect();
     }
+    BestPossibleExternalViewVerifier verifier = new BestPossibleExternalViewVerifier
+        .Builder(clusterName).setZkAddress(ZK_ADDR).build();
 
-    boolean result = ClusterStateVerifier
-        .verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR, clusterName));
+    boolean result = verifier.verifyByZkCallback();
     Assert.assertTrue(result);
 
     // disconnect first distributed-controller, and verify second takes leadership
     distributedControllers[0].disconnect();
 
     // verify leader changes to localhost_12919
     Thread.sleep(100);

Review Comment:
   since I got +1, i will do it. Typically, i try to do specific change rather than mix 2/3 things in one. cognitive load increases.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] parakhnr commented on a diff in pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "parakhnr (via GitHub)" <gi...@apache.org>.
parakhnr commented on code in PR #2505:
URL: https://github.com/apache/helix/pull/2505#discussion_r1204570885


##########
helix-core/src/test/java/org/apache/helix/integration/manager/TestDistributedControllerManager.java:
##########
@@ -71,18 +72,18 @@ public void simpleIntegrationTest() throws Exception {
           new MockMSModelFactory());
       distributedControllers[i].connect();
     }
+    BestPossibleExternalViewVerifier verifier = new BestPossibleExternalViewVerifier
+        .Builder(clusterName).setZkAddress(ZK_ADDR).build();
 
-    boolean result = ClusterStateVerifier
-        .verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR, clusterName));
+    boolean result = verifier.verifyByZkCallback();
     Assert.assertTrue(result);
 
     // disconnect first distributed-controller, and verify second takes leadership
     distributedControllers[0].disconnect();
 
     // verify leader changes to localhost_12919
     Thread.sleep(100);

Review Comment:
   I know this change is just for refactoring but if you want can we use `TestHelper.verify()` instead of using `Thread.sleep()`.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] desaikomal commented on a diff in pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "desaikomal (via GitHub)" <gi...@apache.org>.
desaikomal commented on code in PR #2505:
URL: https://github.com/apache/helix/pull/2505#discussion_r1205789134


##########
helix-core/src/test/java/org/apache/helix/integration/manager/TestDistributedControllerManager.java:
##########
@@ -82,8 +82,9 @@ public void simpleIntegrationTest() throws Exception {
     distributedControllers[0].disconnect();
 
     // verify leader changes to localhost_12919
-    Thread.sleep(100);
-    result = verifier.verifyByZkCallback();
+    result = TestHelper.verify(() -> {
+      return verifier.verifyByZkCallback();
+    }, 100);

Review Comment:
   Still re-try is not required, can you please review it one final time.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] desaikomal commented on pull request #2505: Replace deprecated verifier with new set of Verifiers

Posted by "desaikomal (via GitHub)" <gi...@apache.org>.
desaikomal commented on PR #2505:
URL: https://github.com/apache/helix/pull/2505#issuecomment-1564409486

   Thanks @qqu0127 and @parakhnr for review. This change has been approved by @parakhnr and @qqu0127.
   Commit message: Replace the deprecated verifier with new set of verifiers.


-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org