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

Fix Master Failover and DataNode Leave Blocked Snapshot #38460

Merged
merged 1 commit into from
Feb 5, 2019
Merged
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 @@ -687,8 +687,9 @@ public void applyClusterState(ClusterChangedEvent event) {
if (event.localNodeMaster()) {
// We don't remove old master when master flips anymore. So, we need to check for change in master
final SnapshotsInProgress snapshotsInProgress = event.state().custom(SnapshotsInProgress.TYPE);
final boolean newMaster = event.previousState().nodes().isLocalNodeElectedMaster() == false;
if (snapshotsInProgress != null) {
if (removedNodesCleanupNeeded(snapshotsInProgress, event.nodesDelta().removedNodes())) {
if (newMaster || removedNodesCleanupNeeded(snapshotsInProgress, event.nodesDelta().removedNodes())) {
processSnapshotsOnRemovedNodes();
}
if (event.routingTableChanged() && waitingShardsStartedOrUnassigned(snapshotsInProgress, event)) {
Expand All @@ -704,7 +705,7 @@ public void applyClusterState(ClusterChangedEvent event) {
|| entry.state() != State.INIT && completed(entry.shards().values())
).forEach(this::endSnapshot);
}
if (event.previousState().nodes().isLocalNodeElectedMaster() == false) {
if (newMaster) {
finalizeSnapshotDeletionFromPreviousMaster(event);
}
}
Expand Down