Skip to content

Commit 77b4fd5

Browse files
Fix logsdb rolling upgrade tests again (#135499)
This patch addresses the new failures by moving the node feature check such that it is executed before any nodes are upgraded.
1 parent f5e37e7 commit 77b4fd5

File tree

10 files changed

+15
-112
lines changed

10 files changed

+15
-112
lines changed

muted-tests.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -615,57 +615,9 @@ tests:
615615
- class: org.elasticsearch.upgrades.SearchableSnapshotsRollingUpgradeIT
616616
method: testBlobStoreCacheWithFullCopyInMixedVersions
617617
issue: https://github.com/elastic/elasticsearch/issues/135474
618-
- class: org.elasticsearch.upgrades.SyntheticSourceRollingUpgradeIT
619-
method: testIndexing {upgradedNodes=3}
620-
issue: https://github.com/elastic/elasticsearch/issues/135338
621618
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
622619
method: test
623620
issue: https://github.com/elastic/elasticsearch/issues/134407
624-
- class: org.elasticsearch.upgrades.LogsUsageRollingUpgradeIT
625-
method: testUsage {upgradedNodes=3}
626-
issue: https://github.com/elastic/elasticsearch/issues/135312
627-
- class: org.elasticsearch.upgrades.NoLogsUsageRollingUpgradeIT
628-
method: testUsage {upgradedNodes=3}
629-
issue: https://github.com/elastic/elasticsearch/issues/135316
630-
- class: org.elasticsearch.upgrades.LogsdbIndexingRollingUpgradeIT
631-
method: testIndexing {upgradedNodes=3}
632-
issue: https://github.com/elastic/elasticsearch/issues/135320
633-
- class: org.elasticsearch.upgrades.TextRollingUpgradeIT
634-
method: testIndexing {upgradedNodes=3}
635-
issue: https://github.com/elastic/elasticsearch/issues/135237
636-
- class: org.elasticsearch.upgrades.StandardToLogsDbIndexModeRollingUpgradeIT
637-
method: testLogsIndexing {upgradedNodes=3}
638-
issue: https://github.com/elastic/elasticsearch/issues/135315
639-
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT
640-
method: testIndexing {upgradedNodes=3}
641-
issue: https://github.com/elastic/elasticsearch/issues/135324
642-
- class: org.elasticsearch.upgrades.LogsdbIndexingRollingUpgradeIT
643-
method: testIndexing {upgradedNodes=2}
644-
issue: https://github.com/elastic/elasticsearch/issues/135327
645-
- class: org.elasticsearch.upgrades.TextRollingUpgradeIT
646-
method: testIndexing {upgradedNodes=2}
647-
issue: https://github.com/elastic/elasticsearch/issues/135238
648-
- class: org.elasticsearch.upgrades.TextRollingUpgradeIT
649-
method: testIndexing {upgradedNodes=1}
650-
issue: https://github.com/elastic/elasticsearch/issues/135236
651-
- class: org.elasticsearch.upgrades.SyntheticSourceRollingUpgradeIT
652-
method: testIndexing {upgradedNodes=2}
653-
issue: https://github.com/elastic/elasticsearch/issues/135344
654-
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT
655-
method: testIndexing {upgradedNodes=2}
656-
issue: https://github.com/elastic/elasticsearch/issues/135325
657-
- class: org.elasticsearch.upgrades.LogsdbIndexingRollingUpgradeIT
658-
method: testIndexing {upgradedNodes=1}
659-
issue: https://github.com/elastic/elasticsearch/issues/135511
660-
- class: org.elasticsearch.upgrades.SyntheticSourceRollingUpgradeIT
661-
method: testIndexing {upgradedNodes=1}
662-
issue: https://github.com/elastic/elasticsearch/issues/135512
663-
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT
664-
method: testIndexing {upgradedNodes=1}
665-
issue: https://github.com/elastic/elasticsearch/issues/135525
666-
- class: org.elasticsearch.upgrades.NoLogsUsageRollingUpgradeIT
667-
method: testUsage {upgradedNodes=2}
668-
issue: https://github.com/elastic/elasticsearch/issues/135319
669621

670622
# Examples:
671623
#

qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/ParameterizedFullClusterRestartTestCase.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,16 @@ public void extractOldIndexVersion() throws Exception {
100100
}
101101
}
102102

103+
protected void beforeUpgrade() {
104+
if (getOldClusterVersion().endsWith("-SNAPSHOT")) {
105+
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
106+
}
107+
}
108+
103109
@Before
104110
public void maybeUpgrade() throws Exception {
105111
if (upgraded == false && requestedUpgradeStatus == UPGRADED) {
112+
beforeUpgrade();
106113
try {
107114
if (getOldClusterTestVersion().before(MINIMUM_WIRE_COMPATIBLE_VERSION)) {
108115
// First upgrade to latest wire compatible version

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/ParameterizedRollingUpgradeTestCase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ public static Iterable<Object[]> parameters() {
5454

5555
protected abstract ElasticsearchCluster getUpgradeCluster();
5656

57+
protected void beforeUpgrade() {
58+
if (getOldClusterVersion().endsWith("-SNAPSHOT")) {
59+
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
60+
}
61+
}
62+
5763
@Before
5864
public void upgradeNode() throws Exception {
5965
// extract old cluster features
@@ -96,6 +102,8 @@ public void upgradeNode() throws Exception {
96102
// Skip remaining tests if upgrade failed
97103
assumeFalse("Cluster upgrade failed", upgradeFailed);
98104

105+
beforeUpgrade();
106+
99107
// finally, upgrade node
100108
if (upgradedNodes.size() < requestedUpgradedNodes) {
101109
closeClients();

x-pack/plugin/logsdb/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/LogsUsageRollingUpgradeIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313

14-
import org.elasticsearch.Build;
1514
import org.elasticsearch.client.Request;
16-
import org.junit.Before;
1715

1816
import java.io.IOException;
1917
import java.time.Instant;
@@ -31,13 +29,6 @@ public LogsUsageRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
3129
super(upgradedNodes);
3230
}
3331

34-
@Before
35-
public void checkFeatures() {
36-
if (Build.current().isSnapshot()) {
37-
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
38-
}
39-
}
40-
4132
public void testUsage() throws Exception {
4233
assumeFalse("logsdb.prior_logs_usage only gets set in 8.x", oldClusterHasFeature("gte_v9.0.0"));
4334
String dataStreamName = "logs-mysql-error";

x-pack/plugin/logsdb/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/LogsdbIndexingRollingUpgradeIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313

14-
import org.elasticsearch.Build;
1514
import org.elasticsearch.client.Request;
1615
import org.elasticsearch.client.Response;
1716
import org.elasticsearch.client.ResponseException;
@@ -21,7 +20,6 @@
2120
import org.elasticsearch.common.xcontent.XContentHelper;
2221
import org.elasticsearch.test.rest.ObjectPath;
2322
import org.elasticsearch.xcontent.XContentType;
24-
import org.junit.Before;
2523

2624
import java.io.IOException;
2725
import java.io.InputStream;
@@ -76,13 +74,6 @@ public LogsdbIndexingRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes)
7674
super(upgradedNodes);
7775
}
7876

79-
@Before
80-
public void checkFeatures() {
81-
if (Build.current().isSnapshot()) {
82-
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
83-
}
84-
}
85-
8677
public void testIndexing() throws Exception {
8778
String dataStreamName = "logs-bwc-test";
8879
if (isOldCluster()) {

x-pack/plugin/logsdb/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/MatchOnlyTextRollingUpgradeIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313

14-
import org.elasticsearch.Build;
1514
import org.elasticsearch.client.Request;
1615
import org.elasticsearch.client.Response;
1716
import org.elasticsearch.client.ResponseException;
@@ -22,7 +21,6 @@
2221
import org.elasticsearch.index.mapper.MapperFeatures;
2322
import org.elasticsearch.test.rest.ObjectPath;
2423
import org.elasticsearch.xcontent.XContentType;
25-
import org.junit.Before;
2624

2725
import java.io.IOException;
2826
import java.io.InputStream;
@@ -92,13 +90,6 @@ public MatchOnlyTextRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
9290
super(upgradedNodes);
9391
}
9492

95-
@Before
96-
public void checkFeatures() {
97-
if (Build.current().isSnapshot()) {
98-
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
99-
}
100-
}
101-
10293
public void testIndexing() throws Exception {
10394
assumeTrue(
10495
"Match only text block loader fix is not present in this cluster",

x-pack/plugin/logsdb/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/NoLogsUsageRollingUpgradeIT.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313

14-
import org.elasticsearch.Build;
15-
import org.junit.Before;
16-
1714
import java.time.Instant;
1815
import java.util.Map;
1916

@@ -29,13 +26,6 @@ public NoLogsUsageRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
2926
super(upgradedNodes);
3027
}
3128

32-
@Before
33-
public void checkFeatures() {
34-
if (Build.current().isSnapshot()) {
35-
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
36-
}
37-
}
38-
3929
public void testUsage() throws Exception {
4030
String dataStreamName = "logs-mysql-error";
4131
if (isOldCluster()) {

x-pack/plugin/logsdb/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/StandardToLogsDbIndexModeRollingUpgradeIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313

14-
import org.elasticsearch.Build;
1514
import org.elasticsearch.client.Request;
1615
import org.elasticsearch.client.Response;
1716
import org.elasticsearch.client.RestClient;
@@ -25,7 +24,6 @@
2524
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
2625
import org.hamcrest.Matcher;
2726
import org.hamcrest.Matchers;
28-
import org.junit.Before;
2927
import org.junit.ClassRule;
3028

3129
import java.io.IOException;
@@ -116,13 +114,6 @@ protected Settings restClientSettings() {
116114
}
117115
}""";
118116

119-
@Before
120-
public void checkFeatures() {
121-
if (Build.current().isSnapshot()) {
122-
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
123-
}
124-
}
125-
126117
public void testLogsIndexing() throws IOException {
127118
if (isOldCluster()) {
128119
// given - create a template and data stream

x-pack/plugin/logsdb/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/SyntheticSourceRollingUpgradeIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111

1212
import com.carrotsearch.randomizedtesting.annotations.Name;
1313

14-
import org.elasticsearch.Build;
1514
import org.elasticsearch.client.Request;
1615
import org.elasticsearch.test.rest.ObjectPath;
1716
import org.hamcrest.Matchers;
18-
import org.junit.Before;
1917

2018
import java.time.Instant;
2119
import java.util.Arrays;
@@ -72,13 +70,6 @@ public SyntheticSourceRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes)
7270
super(upgradedNodes);
7371
}
7472

75-
@Before
76-
public void checkFeatures() {
77-
if (Build.current().isSnapshot()) {
78-
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
79-
}
80-
}
81-
8273
public void testIndexing() throws Exception {
8374
assumeTrue("requires storing leaf array offsets", oldClusterHasFeature("gte_v9.1.0"));
8475
String dataStreamName = "logs-bwc-test";

x-pack/plugin/logsdb/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/TextRollingUpgradeIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import com.carrotsearch.randomizedtesting.annotations.Name;
1111

12-
import org.elasticsearch.Build;
1312
import org.elasticsearch.client.Request;
1413
import org.elasticsearch.client.Response;
1514
import org.elasticsearch.client.ResponseException;
@@ -19,7 +18,6 @@
1918
import org.elasticsearch.common.xcontent.XContentHelper;
2019
import org.elasticsearch.test.rest.ObjectPath;
2120
import org.elasticsearch.xcontent.XContentType;
22-
import org.junit.Before;
2321

2422
import java.io.IOException;
2523
import java.io.InputStream;
@@ -89,13 +87,6 @@ public TextRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
8987
super(upgradedNodes);
9088
}
9189

92-
@Before
93-
public void checkFeatures() {
94-
if (Build.current().isSnapshot()) {
95-
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
96-
}
97-
}
98-
9990
public void testIndexing() throws Exception {
10091

10192
if (isOldCluster()) {

0 commit comments

Comments
 (0)