Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the Master nomenclature in 2.3 #548

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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