Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -615,57 +615,9 @@ tests:
- class: org.elasticsearch.upgrades.SearchableSnapshotsRollingUpgradeIT
method: testBlobStoreCacheWithFullCopyInMixedVersions
issue: https://github.com/elastic/elasticsearch/issues/135474
- class: org.elasticsearch.upgrades.SyntheticSourceRollingUpgradeIT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a few more tests need to be unmuted now.

method: testIndexing {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/135338
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
method: test
issue: https://github.com/elastic/elasticsearch/issues/134407
- class: org.elasticsearch.upgrades.LogsUsageRollingUpgradeIT
method: testUsage {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/135312
- class: org.elasticsearch.upgrades.NoLogsUsageRollingUpgradeIT
method: testUsage {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/135316
- class: org.elasticsearch.upgrades.LogsdbIndexingRollingUpgradeIT
method: testIndexing {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/135320
- class: org.elasticsearch.upgrades.TextRollingUpgradeIT
method: testIndexing {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/135237
- class: org.elasticsearch.upgrades.StandardToLogsDbIndexModeRollingUpgradeIT
method: testLogsIndexing {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/135315
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT
method: testIndexing {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/135324
- class: org.elasticsearch.upgrades.LogsdbIndexingRollingUpgradeIT
method: testIndexing {upgradedNodes=2}
issue: https://github.com/elastic/elasticsearch/issues/135327
- class: org.elasticsearch.upgrades.TextRollingUpgradeIT
method: testIndexing {upgradedNodes=2}
issue: https://github.com/elastic/elasticsearch/issues/135238
- class: org.elasticsearch.upgrades.TextRollingUpgradeIT
method: testIndexing {upgradedNodes=1}
issue: https://github.com/elastic/elasticsearch/issues/135236
- class: org.elasticsearch.upgrades.SyntheticSourceRollingUpgradeIT
method: testIndexing {upgradedNodes=2}
issue: https://github.com/elastic/elasticsearch/issues/135344
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT
method: testIndexing {upgradedNodes=2}
issue: https://github.com/elastic/elasticsearch/issues/135325
- class: org.elasticsearch.upgrades.LogsdbIndexingRollingUpgradeIT
method: testIndexing {upgradedNodes=1}
issue: https://github.com/elastic/elasticsearch/issues/135511
- class: org.elasticsearch.upgrades.SyntheticSourceRollingUpgradeIT
method: testIndexing {upgradedNodes=1}
issue: https://github.com/elastic/elasticsearch/issues/135512
- class: org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT
method: testIndexing {upgradedNodes=1}
issue: https://github.com/elastic/elasticsearch/issues/135525
- class: org.elasticsearch.upgrades.NoLogsUsageRollingUpgradeIT
method: testUsage {upgradedNodes=2}
issue: https://github.com/elastic/elasticsearch/issues/135319

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,16 @@ public void extractOldIndexVersion() throws Exception {
}
}

protected void beforeUpgrade() {
if (getOldClusterVersion().endsWith("-SNAPSHOT")) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

@Before
public void maybeUpgrade() throws Exception {
if (upgraded == false && requestedUpgradeStatus == UPGRADED) {
beforeUpgrade();
try {
if (getOldClusterTestVersion().before(MINIMUM_WIRE_COMPATIBLE_VERSION)) {
// First upgrade to latest wire compatible version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public static Iterable<Object[]> parameters() {

protected abstract ElasticsearchCluster getUpgradeCluster();

protected void beforeUpgrade() {
if (getOldClusterVersion().endsWith("-SNAPSHOT")) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

@Before
public void upgradeNode() throws Exception {
// extract old cluster features
Expand Down Expand Up @@ -96,6 +102,8 @@ public void upgradeNode() throws Exception {
// Skip remaining tests if upgrade failed
assumeFalse("Cluster upgrade failed", upgradeFailed);

beforeUpgrade();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked a few test failures and it fails with fails with indices/data streams that are managed internally. For example the ilm history or deprecation logging.

I think without this change a node upgrade could happen before the @Before method with old feature check was invoked. In the case an internal index is created while the upgrade is in progress. Older nodes don't understand the renamed index setting. This caused the test to fail before it got the old feature check. (cluster would never go into a green state after a node upgraded)

So I think this should ensure that this doesn't happen.


// finally, upgrade node
if (upgradedNodes.size() < requestedUpgradedNodes) {
closeClients();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

import com.carrotsearch.randomizedtesting.annotations.Name;

import org.elasticsearch.Build;
import org.elasticsearch.client.Request;
import org.junit.Before;

import java.io.IOException;
import java.time.Instant;
Expand All @@ -31,13 +29,6 @@ public LogsUsageRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
super(upgradedNodes);
}

@Before
public void checkFeatures() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

public void testUsage() throws Exception {
assumeFalse("logsdb.prior_logs_usage only gets set in 8.x", oldClusterHasFeature("gte_v9.0.0"));
String dataStreamName = "logs-mysql-error";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import com.carrotsearch.randomizedtesting.annotations.Name;

import org.elasticsearch.Build;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
Expand All @@ -21,7 +20,6 @@
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.test.rest.ObjectPath;
import org.elasticsearch.xcontent.XContentType;
import org.junit.Before;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -76,13 +74,6 @@ public LogsdbIndexingRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes)
super(upgradedNodes);
}

@Before
public void checkFeatures() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

public void testIndexing() throws Exception {
String dataStreamName = "logs-bwc-test";
if (isOldCluster()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import com.carrotsearch.randomizedtesting.annotations.Name;

import org.elasticsearch.Build;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
Expand All @@ -22,7 +21,6 @@
import org.elasticsearch.index.mapper.MapperFeatures;
import org.elasticsearch.test.rest.ObjectPath;
import org.elasticsearch.xcontent.XContentType;
import org.junit.Before;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -92,13 +90,6 @@ public MatchOnlyTextRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
super(upgradedNodes);
}

@Before
public void checkFeatures() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

public void testIndexing() throws Exception {
assumeTrue(
"Match only text block loader fix is not present in this cluster",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

import com.carrotsearch.randomizedtesting.annotations.Name;

import org.elasticsearch.Build;
import org.junit.Before;

import java.time.Instant;
import java.util.Map;

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

@Before
public void checkFeatures() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

public void testUsage() throws Exception {
String dataStreamName = "logs-mysql-error";
if (isOldCluster()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import com.carrotsearch.randomizedtesting.annotations.Name;

import org.elasticsearch.Build;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.RestClient;
Expand All @@ -25,7 +24,6 @@
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.ClassRule;

import java.io.IOException;
Expand Down Expand Up @@ -116,13 +114,6 @@ protected Settings restClientSettings() {
}
}""";

@Before
public void checkFeatures() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

public void testLogsIndexing() throws IOException {
if (isOldCluster()) {
// given - create a template and data stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

import com.carrotsearch.randomizedtesting.annotations.Name;

import org.elasticsearch.Build;
import org.elasticsearch.client.Request;
import org.elasticsearch.test.rest.ObjectPath;
import org.hamcrest.Matchers;
import org.junit.Before;

import java.time.Instant;
import java.util.Arrays;
Expand Down Expand Up @@ -72,13 +70,6 @@ public SyntheticSourceRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes)
super(upgradedNodes);
}

@Before
public void checkFeatures() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

public void testIndexing() throws Exception {
assumeTrue("requires storing leaf array offsets", oldClusterHasFeature("gte_v9.1.0"));
String dataStreamName = "logs-bwc-test";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import com.carrotsearch.randomizedtesting.annotations.Name;

import org.elasticsearch.Build;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
Expand All @@ -19,7 +18,6 @@
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.test.rest.ObjectPath;
import org.elasticsearch.xcontent.XContentType;
import org.junit.Before;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -89,13 +87,6 @@ public TextRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
super(upgradedNodes);
}

@Before
public void checkFeatures() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
}

public void testIndexing() throws Exception {

if (isOldCluster()) {
Expand Down