From 7feb4d51591389fbaefe003f6e58596a7e5cbddb Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Tue, 29 Oct 2024 12:03:06 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"[test]=20Dynamically=20pick=20up=20th?= =?UTF-8?q?e=20upper=20bound=20snapshot=20index=20version=20(#1=E2=80=A6"?= =?UTF-8?q?=20(#115827)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 32dee6aaaeb18a8d6d4f0fee8bbf338e8991650d. --- .../snapshots/AbstractSnapshotIntegTestCase.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java index 7a72a7bd0daf0..8bc81fef2157d 100644 --- a/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java @@ -34,6 +34,7 @@ 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; @@ -365,9 +366,15 @@ 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.randomVersion()); + initWithSnapshotVersion( + repoName, + repoPath, + IndexVersionUtils.randomVersionBetween(random(), IndexVersions.MINIMUM_COMPATIBLE, IndexVersions.V_8_9_0) + ); } }