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

Mute recover from snapshot rolling first round #76601

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 @@ -25,6 +25,7 @@

import static org.elasticsearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING;
import static org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY;
import static org.elasticsearch.upgrades.AbstractRollingTestCase.ClusterType.MIXED;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
Expand Down Expand Up @@ -64,8 +65,16 @@ public void testSnapshotBasedRecovery() throws Exception {
break;
case MIXED:
case UPGRADED:
// Drop replicas
updateIndexSettings(indexName, Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0));
// the following `if` for first round mixed was added as a selective test mute. Sometimes the primary shard ends
// on the upgraded node. This causes issues when removing and adding replicas, since then we cannot allocate to
// any of the old nodes. That is an issue only for the first mixed round, hence this check.
// Ideally we would find the reason the primary ends on the upgraded node and fix that (or figure out that it
// is all good).
// @AwaitsFix(bugUrl = https://github.com/elastic/elasticsearch/issues/76595)
if (CLUSTER_TYPE != MIXED || FIRST_MIXED_ROUND == false) {
// Drop replicas
updateIndexSettings(indexName, Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0));
}
ensureGreen(indexName);

updateIndexSettings(indexName, Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1));
Expand Down