Skip to content

Commit

Permalink
Deprecate the Master nomenclature (opensearch-project#548)
Browse files Browse the repository at this point in the history
Signed-off-by: Subhobrata Dey <sbcd90@gmail.com>
  • Loading branch information
sbcd90 authored and toepkerd-zz committed Sep 28, 2022
1 parent 39c39ee commit c3821c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class AlertIndices(

@Volatile private var requestTimeout = AlertingSettings.REQUEST_TIMEOUT.get(settings)

@Volatile private var isMaster = false
@Volatile private var isClusterManager = false

// for JobsMonitor to report
var lastRolloverTime: TimeValue? = null
Expand Down Expand Up @@ -192,12 +192,12 @@ class AlertIndices(
}

override fun clusterChanged(event: ClusterChangedEvent) {
// Instead of using a LocalNodeMasterListener to track master changes, this service will
// Instead of using a LocalNodeClusterManagerListener to track master changes, this service will
// track them here to avoid conditions where master listener events run after other
// listeners that depend on what happened in the master listener
if (this.isMaster != event.localNodeMaster()) {
this.isMaster = event.localNodeMaster()
if (this.isMaster) {
if (this.isClusterManager != event.localNodeClusterManager()) {
this.isClusterManager = event.localNodeClusterManager()
if (this.isClusterManager) {
onMaster()
} else {
offMaster()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DestinationMigrationCoordinator(
DestinationMigrationUtilService.finishFlag = false
}
if (
event.localNodeMaster() &&
event.localNodeClusterManager() &&
!runningLock &&
(scheduledMigration == null || scheduledMigration!!.isCancelled)
) {
Expand All @@ -62,7 +62,7 @@ class DestinationMigrationCoordinator(
} finally {
runningLock = false
}
} else if (!event.localNodeMaster()) {
} else if (!event.localNodeClusterManager()) {
scheduledMigration?.cancel()
}
}
Expand Down

0 comments on commit c3821c2

Please sign in to comment.