Skip to content

Commit

Permalink
Enable scheduler for non-leader in multi-active scheduler configurati…
Browse files Browse the repository at this point in the history
…on (apache#3736)

Co-authored-by: Urmi Mustafi <[email protected]>
  • Loading branch information
2 people authored and phet committed Aug 15, 2023
1 parent 320d8a2 commit 970c9d8
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@ private void handleLeadershipChange(NotificationContext changeContext) {
LOGGER.info("Leader lost notification for {} HM.isLeader {}", this.helixManager.get().getInstanceName(),
this.helixManager.get().isLeader());

if (configuration.isSchedulerEnabled()) {
LOGGER.info("Gobblin Service is now running in slave instance mode, disabling Scheduler.");
if (configuration.isSchedulerEnabled() && !configuration.isMultiActiveSchedulerEnabled()) {
LOGGER.info("Gobblin Service is now running in non-leader mode without multi-active scheduler enabled, "
+ "disabling Scheduler.");
this.scheduler.setActive(false);
}

Expand Down Expand Up @@ -473,7 +474,12 @@ public void start() throws ApplicationException {

} else {
if (configuration.isSchedulerEnabled()) {
LOGGER.info("[Init] Gobblin Service is running in slave instance mode, not enabling Scheduler.");
if (configuration.isMultiActiveSchedulerEnabled()) {
LOGGER.info("[Init] Gobblin Service enabling scheduler for non-leader since multi-active scheduler enabled");
this.scheduler.setActive(true);
} else {
LOGGER.info("[Init] Gobblin Service is running in non-leader instance mode, not enabling Scheduler.");
}
}
if (helixLeaderGauges.isPresent()) {
helixLeaderGauges.get().setState(LeaderState.SLAVE);
Expand Down

0 comments on commit 970c9d8

Please sign in to comment.