pkuwm commented on a change in pull request #1066:
URL: https://github.com/apache/helix/pull/1066#discussion_r465476756
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
##########
@@ -757,9 +753,20 @@ private void handleEvent(ClusterEvent event,
BaseControllerDataProvider dataProv
}
event.addAttribute(AttributeName.ControllerDataProvider.name(),
dataProvider);
- logger.info(String.format("START: Invoking %s controller pipeline for
cluster %s event: %s %s",
- manager.getClusterName(), dataProvider.getPipelineName(),
event.getEventType(),
- event.getEventId()));
+ // If manager session changes, no need to run pipeline for the stale event.
+ Optional<String> eventSessionId =
event.getAttribute(AttributeName.EVENT_SESSION.name());
+ String managerSessionId = manager.getSessionId();
Review comment:
@kaisun2000 Here if session id from manager is different from event
session -- the session is changed. We check it and stop processing the event or
sending messages.
The check in Zkclient is the last step. Most of the time this check here
will stop the stale session sending messages.
Regarding other events, each time an event is created, we add the
event_session to it. The event session is from cluster manager.
`if (!eventSessionId.isPresent() ||
!eventSessionId.get().equals(managerSessionId)) {` only it's leader and session
doesn't change, it continues, otherwise, pipeline is not invoked.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]