Skip to content

Commit

Permalink
[test] Dynamically pick up the upper bound snapshot index version (el…
Browse files Browse the repository at this point in the history
…astic#114703)

Pick an index version between the minimum compatible and latest known
version for snapshot testing.
  • Loading branch information
arteam authored Oct 23, 2024
1 parent ba7d095 commit 32dee6a
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.index.IndexVersion;
import org.elasticsearch.index.IndexVersions;
import org.elasticsearch.plugins.Plugin;
Expand Down Expand Up @@ -366,15 +365,9 @@ protected static Settings.Builder indexSettingsNoReplicas(int shards) {
/**
* Randomly write an empty snapshot of an older version to an empty repository to simulate an older repository metadata format.
*/
@UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_COORDINATION)
// This used to pick an index version from 7.0.0 to 8.9.0. The minimum now is 8.0.0 but it's not clear what the upper range should be
protected void maybeInitWithOldSnapshotVersion(String repoName, Path repoPath) throws Exception {
if (randomBoolean() && randomBoolean()) {
initWithSnapshotVersion(
repoName,
repoPath,
IndexVersionUtils.randomVersionBetween(random(), IndexVersions.MINIMUM_COMPATIBLE, IndexVersions.V_8_9_0)
);
initWithSnapshotVersion(repoName, repoPath, IndexVersionUtils.randomVersion());
}
}

Expand Down

0 comments on commit 32dee6a

Please sign in to comment.