jiajunwang commented on a change in pull request #690: Reset the WAGED 
rebalancer once the controller newly acquires leadership.
URL: https://github.com/apache/helix/pull/690#discussion_r369871376
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
 ##########
 @@ -626,6 +631,22 @@ private void handleEvent(ClusterEvent event, 
BaseControllerDataProvider dataProv
       return;
     }
 
+    // Event handling happens in a different thread from the 
onControllerChange processing thread.
+    // Thus, there are several possible conditions.
+    // 1. Event handled after leadership acquired. So we will have a valid 
rebalancer for the
+    // event processing.
+    // 2. Event handled shortly after leadership relinquished. And the 
rebalancer has not been
+    // marked as invalid yet. So the event will be processed the same as case 
one.
+    // 3. Event is leftover from the previous session, and it is handled when 
the controller
+    // regains the leadership. The rebalancer will be reset before being used. 
That is the
+    // expected behavior so as to avoid inconsistent rebalance result.
+    // 4. Event handled shortly after leadership relinquished. And the 
rebalancer has been marked
+    // as invalid. So we reset the rebalancer. But the later isLeader() check 
will return false and
 
 Review comment:
   1. in event thread, check if is leader, return true, so event thread 
continues
   2. in the ZK thread, session expired, so handling triggered, and leadership 
switch is done.
   3. in the event thread, keep triggering the pipeline.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to