-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Don't recover from buggy version #9925
Conversation
+1 this looks great. |
+1 |
return; | ||
final Version sourceNodeVersion = recoveryStatus.sourceNode().version(); | ||
if (sourceNodeVersion.before(Version.V_1_3_2) && recoverySettings.compress()) { // don't recover from pre 1.3.2 if compression is on? | ||
throw new ElasticsearchIllegalStateException("Can't recovery from node " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't recovery -> Can't recover
+1, just left a couple minor comments. |
@mikemccand @rmuir @rjernst pushed a new commit with unittests... |
recoveryTarget.existingFiles(discoNode, store, withCompression); | ||
assertTrue(discoNode.version() + " " + withCompression, version.onOrAfter(Version.V_1_3_2) || withCompression == false); | ||
} catch (ElasticsearchIllegalStateException ex) { | ||
// all is good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we check that we expect this exception? i.e., when version is before 1.3.2 and compression is on?
+1 on the change. I think the 1.3.2 part is better implemented as an allocation decider to prevent the master repeatedly trying to allocate it and failing. I checked and it's fairly easy to integrate this into
|
@bleskes here is a new commit |
// clusterState = stabilize(clusterState, service); | ||
// routingTable = clusterState.routingTable(); | ||
// for (int i = 0; i < routingTable.index("test").shards().size(); i++) { | ||
// assertThat(routingTable.index("test").shard(i).shards().size(), equalTo(3)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left overs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm yeah :D
LGTM. Thx @s1monw |
This commit forces a full recovery if the source node is < 1.4.0 and prevents any recoveries from pre 1.3.2 nodes if compression is enabled to work around elastic#7210 Closes elastic#9922
Closes #9922 |
This commit forces a full recovery if the source node is < 1.4.0 and
prevents any recoveries from pre 1.3.2 nodes to
work around #7210
Closes #9922
note: this is just a start, I need to fix some BWC test first before this can be pulled in but I wanted to get the discussion going