Fix BwC Snapshot INIT Path#60006
Merged
original-brownbear merged 2 commits intoelastic:7.xfrom Jul 22, 2020
original-brownbear:59986
Merged
Fix BwC Snapshot INIT Path#60006original-brownbear merged 2 commits intoelastic:7.xfrom original-brownbear:59986
original-brownbear merged 2 commits intoelastic:7.xfrom
original-brownbear:59986
Conversation
There were two subtle bugs here from backporting #56911 to 7.x. 1. We passed `null` for the `shards` map which isn't nullable any longer when creating `SnapshotsInProgress.Entry`, fixed by just passing an empty map like the `null` handling did in the past. 2. The removal of a failed `INIT` state snapshot from the cluster state tried removing it from the finalization loop (the set of repository names that are currently finalizing). This will trip an assertion since the snapshot failed before its repository was put into the set. I made the logic ignore the set in case we remove a failed `INIT` state snapshot to restore the old logic to exactly as it was before the concurrent snapshots backport to be on the safe side here. Also, added tests that explicitly call the old code paths because as can be seen from initially missing this, the BwC tests will only run in the configuration new version master, old version nodes ever so often and having a deterministic test for the old state machine seems the safest bet here. Closes #59986
ywelsch
approved these changes
Jul 22, 2020
| private void removeFailedSnapshotFromClusterState(Snapshot snapshot, Exception failure, @Nullable RepositoryData repositoryData, | ||
| @Nullable CleanupAfterErrorListener listener) { | ||
| assert failure != null : "Failure must be supplied"; | ||
| assert (listener == null || repositoryData == null) && (repositoryData != null || listener != null) : |
Contributor
There was a problem hiding this comment.
maybe refomulate this as (listener == null && repositoryData == null) == false?
Contributor
Author
|
Thanks Yannick + Tanguy! |
This was referenced Jul 22, 2020
original-brownbear
added a commit
that referenced
this pull request
Jul 22, 2020
There were two subtle bugs here from backporting #56911 to 7.x. 1. We passed `null` for the `shards` map which isn't nullable any longer when creating `SnapshotsInProgress.Entry`, fixed by just passing an empty map like the `null` handling did in the past. 2. The removal of a failed `INIT` state snapshot from the cluster state tried removing it from the finalization loop (the set of repository names that are currently finalizing). This will trip an assertion since the snapshot failed before its repository was put into the set. I made the logic ignore the set in case we remove a failed `INIT` state snapshot to restore the old logic to exactly as it was before the concurrent snapshots backport to be on the safe side here. Also, added tests that explicitly call the old code paths because as can be seen from initially missing this, the BwC tests will only run in the configuration new version master, old version nodes ever so often and having a deterministic test for the old state machine seems the safest bet here. Closes #59986
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There were two subtle bugs here from backporting #56911 to 7.x.
nullfor theshardsmap which isn't nullable any longerwhen creating
SnapshotsInProgress.Entry, fixed by just passing an empty maplike the
nullhandling did in the past.INITstate snapshot from the cluster state triedremoving it from the finalization loop (the set of repository names that are
currently finalizing). This will trip an assertion since the snapshot failed
before its repository was put into the set. I made the logic ignore the set
in case we remove a failed
INITstate snapshot to restore the old logic toexactly as it was before the concurrent snapshots backport to be on the safe
side here.
Also, added tests that explicitly call the old code paths because as can be seen
from initially missing this, the BwC tests will only run in the configuration new
version master, old version nodes ever so often and having a deterministic test
for the old state machine seems the safest bet here.
Closes #59986
Marking non-issues since this was never released but blocker because it completely breaks mixed version cluster snapshots if there's a new version master node mixed with pre-7.5 nodes.