Skip to content

Commit 6a05506

Browse files
authored
Restore use of v7 index versions in snapshot tests (#119133)
Versions v7 have been filtered out when we bumped to v9, but that was not necessary. Actually, given we decided to keep on supporting v7 indices, it is important to restore such tests.
1 parent 5f9a9e0 commit 6a05506

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

server/src/internalClusterTest/java/org/elasticsearch/repositories/IndexSnapshotsServiceIT.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.elasticsearch.cluster.metadata.IndexMetadata;
2020
import org.elasticsearch.common.util.CollectionUtils;
2121
import org.elasticsearch.core.Strings;
22-
import org.elasticsearch.core.UpdateForV9;
2322
import org.elasticsearch.index.Index;
2423
import org.elasticsearch.index.IndexVersion;
2524
import org.elasticsearch.index.IndexVersions;
@@ -109,16 +108,14 @@ public void testGetShardSnapshotOnEmptyRepositoriesListThrowsAnError() {
109108
expectThrows(IllegalArgumentException.class, () -> getLatestSnapshotForShardFuture(Collections.emptyList(), "idx", 0, false));
110109
}
111110

112-
@UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_COORDINATION)
113-
// below we were selecting an index version between current and 7.5.0, this has been updated to 8.0.0 now but that might need to change
114111
public void testGetShardSnapshotReturnsTheLatestSuccessfulSnapshot() throws Exception {
115112
final String repoName = "repo-name";
116113
final Path repoPath = randomRepoPath();
117114
createRepository(repoName, FsRepository.TYPE, repoPath);
118115

119116
final boolean useBwCFormat = randomBoolean();
120117
if (useBwCFormat) {
121-
final IndexVersion version = randomVersionBetween(random(), IndexVersions.MINIMUM_COMPATIBLE, IndexVersion.current());
118+
final IndexVersion version = randomVersionBetween(random(), IndexVersions.V_7_5_0, IndexVersion.current());
122119
initWithSnapshotVersion(repoName, repoPath, version);
123120
}
124121

test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java

Lines changed: 1 addition & 4 deletions
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;
@@ -367,14 +366,12 @@ protected static Settings.Builder indexSettingsNoReplicas(int shards) {
367366
/**
368367
* Randomly write an empty snapshot of an older version to an empty repository to simulate an older repository metadata format.
369368
*/
370-
@UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_COORDINATION)
371-
// 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
372369
protected void maybeInitWithOldSnapshotVersion(String repoName, Path repoPath) throws Exception {
373370
if (randomBoolean() && randomBoolean()) {
374371
initWithSnapshotVersion(
375372
repoName,
376373
repoPath,
377-
IndexVersionUtils.randomVersionBetween(random(), IndexVersions.MINIMUM_COMPATIBLE, IndexVersions.V_8_9_0)
374+
IndexVersionUtils.randomVersionBetween(random(), IndexVersions.V_7_0_0, IndexVersions.V_8_9_0)
378375
);
379376
}
380377
}

0 commit comments

Comments
 (0)