Skip to content

Commit

Permalink
Mute recover from snapshot rolling first round (#76601)
Browse files Browse the repository at this point in the history
Selectively muting parts of the rolling upgrade test for recover from
snapshot.

Relates #76595
  • Loading branch information
henningandersen authored Aug 17, 2021
1 parent a596848 commit 2bfeab6
Showing 1 changed file with 11 additions and 2 deletions.
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

0 comments on commit 2bfeab6

Please sign in to comment.