Skip to content

Commit dae07f3

Browse files
authored
[TEST] Fix test for 7.last upgrades (#82579) (#82589)
Our bwc tests now always upgrade through 7.last. This PR fixes a race condition related to potentially seeing a 7.last index when we upgrade from 7.non-last.
1 parent 49b44cb commit dae07f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java

+5
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,7 @@ public void testRecovery() throws Exception {
919919

920920
String currentLuceneVersion = Version.CURRENT.luceneVersion.toString();
921921
String bwcLuceneVersion = getOldClusterVersion().luceneVersion.toString();
922+
String minCompatibleBWCVersion = Version.CURRENT.minimumCompatibilityVersion().luceneVersion.toString();
922923
if (shouldHaveTranslog && false == currentLuceneVersion.equals(bwcLuceneVersion)) {
923924
int numCurrentVersion = 0;
924925
int numBwcVersion = 0;
@@ -937,6 +938,10 @@ public void testRecovery() throws Exception {
937938
numCurrentVersion++;
938939
} else if (bwcLuceneVersion.equals(version)) {
939940
numBwcVersion++;
941+
} else if (minCompatibleBWCVersion.equals(version) && minCompatibleBWCVersion.equals(bwcLuceneVersion) == false) {
942+
// Our upgrade path from 7.non-last always goes through 7.last, which depending on timing can create 7.last
943+
// index segment. We ignore those.
944+
continue;
940945
} else {
941946
fail("expected version to be one of [" + currentLuceneVersion + "," + bwcLuceneVersion + "] but was " + line);
942947
}

0 commit comments

Comments
 (0)