Skip to content

Commit 32dee6a

Browse files
authored
[test] Dynamically pick up the upper bound snapshot index version (#114703)
Pick an index version between the minimum compatible and latest known version for snapshot testing.
1 parent ba7d095 commit 32dee6a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Diff for: test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.elasticsearch.common.unit.ByteSizeUnit;
3535
import org.elasticsearch.common.util.concurrent.EsExecutors;
3636
import org.elasticsearch.core.Nullable;
37-
import org.elasticsearch.core.UpdateForV9;
3837
import org.elasticsearch.index.IndexVersion;
3938
import org.elasticsearch.index.IndexVersions;
4039
import org.elasticsearch.plugins.Plugin;
@@ -366,15 +365,9 @@ protected static Settings.Builder indexSettingsNoReplicas(int shards) {
366365
/**
367366
* Randomly write an empty snapshot of an older version to an empty repository to simulate an older repository metadata format.
368367
*/
369-
@UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_COORDINATION)
370-
// 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
371368
protected void maybeInitWithOldSnapshotVersion(String repoName, Path repoPath) throws Exception {
372369
if (randomBoolean() && randomBoolean()) {
373-
initWithSnapshotVersion(
374-
repoName,
375-
repoPath,
376-
IndexVersionUtils.randomVersionBetween(random(), IndexVersions.MINIMUM_COMPATIBLE, IndexVersions.V_8_9_0)
377-
);
370+
initWithSnapshotVersion(repoName, repoPath, IndexVersionUtils.randomVersion());
378371
}
379372
}
380373

0 commit comments

Comments
 (0)