mcvsubbu commented on a change in pull request #4323: [Controller Separation]
Add logic for lead controller resource
URL: https://github.com/apache/incubator-pinot/pull/4323#discussion_r304647565
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java
##########
@@ -255,30 +246,29 @@ private void setUpPinotController() {
_helixResourceManager.start();
HelixManager helixParticipantManager =
_helixResourceManager.getHelixZkManager();
- LOGGER.info("Registering controller leadership manager");
- // TODO: when Helix separation is completed, leadership only depends on
the master in leadControllerResource, remove
- // ControllerLeadershipManager and this callback.
+ // Get lead controller manager from resource manager.
+ _leadControllerManager = _helixResourceManager.getLeadControllerManager();
+
+ LOGGER.info("Registering helix controller listener");
helixParticipantManager.addControllerListener(
- (ControllerChangeListener) changeContext ->
_controllerLeadershipManager.onControllerChange());
+ (ControllerChangeListener) changeContext ->
_leadControllerManager.onHelixControllerChange());
Review comment:
add a comment that this registration is not needed if the resource is
enabled. However, the resource can be disabled sometime while the cluster is in
operation, so we keep it here. Also, it does not add much overhead. At some
point in future when we stop supporting the disabled resoiurce, we will remove
this line altogether and the logic that goes with it.
----------------------------------------------------------------
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]