-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix SnapshotBasedRecoveryIT#testSnapshotBasedRecovery #77134
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 SnapshotBasedRecoveryIT#testSnapshotBasedRecovery #77134
Conversation
Move the shard to a replica in an older version when the primary is located in the upgraded node during the first rolling restart round. Closes elastic#76595
|
Pinging @elastic/es-distributed (Team:Distributed) |
henningandersen
left a comment
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.
I left a couple of comments.
| String currentPrimaryNodeId = getPrimaryNodeIdOfShard(indexName, 0); | ||
| assertThat(getNodeVersion(currentPrimaryNodeId), is(equalTo(UPGRADE_FROM_VERSION))); | ||
|
|
||
| updateIndexSettings( |
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.
I think this risks balancing back the shard to the upgraded node. You can disable balancing and reenable it after reestablishing replica. Or we could just keep the exclusion until the next round. I think I prefer the latter.
| // Drop replicas | ||
| updateIndexSettings(indexName, Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0)); | ||
| if (FIRST_MIXED_ROUND) { | ||
| String primaryNodeId = getPrimaryNodeIdOfShard(indexName, 0); |
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.
I wonder if we should not instead just find the node on the new version and put the exclusion in always? I think there is a risk of the shard moving between the check here and adding replicas below.
henningandersen
left a comment
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.
LGTM.
|
|
||
| // Drop replicas | ||
| updateIndexSettings(indexName, Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0)); | ||
| ensureGreen(indexName); |
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.
I do not think this ensureGreen does anything?
| } | ||
| } | ||
|
|
||
| private void updateIndexSettings(String indexName, Settings settings) throws IOException { |
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.
This looks nearly identical to the static updateIndexSettings inherited from ESRestTestCase, do we need this?
|
@elasticmachine update branch |
|
@elasticmachine update branch |
💚 Backport successful
|
Move the shard to a replica in an older version when the primary is located in the upgraded node during the first rolling restart round. Closes elastic#76595
Move the shard to a replica in an older version when the primary
is located in the upgraded node during the first rolling restart
round.
Closes #76595