Skip to content

Commit

Permalink
[8.x] Make snapshot restore release version check more lenient (elast…
Browse files Browse the repository at this point in the history
…ic#116727) (elastic#116802)

* Make snapshot restore release version check more lenient (elastic#116727)

* Fix stray change
  • Loading branch information
thecoop authored Nov 14, 2024
1 parent f5246cd commit 2811a76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,6 @@ tests:
- class: org.elasticsearch.xpack.restart.CoreFullClusterRestartIT
method: testSnapshotRestore {cluster=UPGRADED}
issue: https://github.com/elastic/elasticsearch/issues/111799
- class: org.elasticsearch.xpack.restart.CoreFullClusterRestartIT
method: testSnapshotRestore {cluster=OLD}
issue: https://github.com/elastic/elasticsearch/issues/111774
- class: org.elasticsearch.upgrades.FullClusterRestartIT
method: testSnapshotRestore {cluster=OLD}
issue: https://github.com/elastic/elasticsearch/issues/111777
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=search/380_sort_segments_on_timestamp/Test that index segments are NOT sorted on timestamp field when @timestamp field is dynamically added}
issue: https://github.com/elastic/elasticsearch/issues/116221
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import static org.elasticsearch.transport.RemoteClusterService.REMOTE_CLUSTER_COMPRESS;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
Expand All @@ -91,6 +92,7 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.startsWith;

/**
* Tests to run before and after a full cluster restart. This is run twice,
Expand Down Expand Up @@ -1285,12 +1287,16 @@ private void checkSnapshot(String snapshotName, int count, String tookOnVersion,
assertEquals(singletonList(snapshotName), XContentMapValues.extractValue("snapshots.snapshot", snapResponse));
assertEquals(singletonList("SUCCESS"), XContentMapValues.extractValue("snapshots.state", snapResponse));
// the format can change depending on the ES node version running & this test code running
// and if there's an in-progress release that hasn't been published yet,
// which could affect the top range of the index release version
String firstReleaseVersion = tookOnIndexVersion.toReleaseVersion().split("-")[0];
assertThat(
XContentMapValues.extractValue("snapshots.version", snapResponse),
(Iterable<String>) XContentMapValues.extractValue("snapshots.version", snapResponse),
anyOf(
equalTo(List.of(tookOnVersion)),
equalTo(List.of(tookOnIndexVersion.toString())),
equalTo(List.of(tookOnIndexVersion.toReleaseVersion()))
contains(tookOnVersion),
contains(tookOnIndexVersion.toString()),
contains(firstReleaseVersion),
contains(startsWith(firstReleaseVersion + "-"))
)
);

Expand Down

0 comments on commit 2811a76

Please sign in to comment.