Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
45 changes: 0 additions & 45 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -618,54 +618,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.index.codec.vectors.cluster.HierarchicalKMeansTests
method: testFewDifferentValues
issue: https://github.com/elastic/elasticsearch/issues/135538
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public static Iterable<Object[]> parameters() {

protected abstract ElasticsearchCluster getUpgradeCluster();

protected void beforeUpgrade() {}

@Before
public void upgradeNode() throws Exception {
// extract old cluster features
Expand Down Expand Up @@ -96,6 +98,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 @@ -13,7 +13,6 @@

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

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

@Before
public void checkFeatures() {
@Override
protected void beforeUpgrade() {
if (Build.current().isSnapshot()) {
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 we should use getOldClusterVersion() and check whether suffix is -SNAPSHOT?

I don't think this works, because this code runs in the jvm that runs the test suite and not Elasticsearch.

assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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,8 +75,8 @@ public LogsdbIndexingRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes)
super(upgradedNodes);
}

@Before
public void checkFeatures() {
@Override
protected void beforeUpgrade() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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,8 +91,8 @@ public MatchOnlyTextRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
super(upgradedNodes);
}

@Before
public void checkFeatures() {
@Override
protected void beforeUpgrade() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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,8 +28,8 @@ public NoLogsUsageRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
super(upgradedNodes);
}

@Before
public void checkFeatures() {
@Override
protected void beforeUpgrade() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,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,8 +115,8 @@ protected Settings restClientSettings() {
}
}""";

@Before
public void checkFeatures() {
@Override
protected void beforeUpgrade() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
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,8 +71,8 @@ public SyntheticSourceRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes)
super(upgradedNodes);
}

@Before
public void checkFeatures() {
@Override
protected void beforeUpgrade() {
if (Build.current().isSnapshot()) {
assumeTrue("rename of pattern_text mapper", oldClusterHasFeature("mapper.pattern_text_rename"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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,8 +88,8 @@ public TextRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
super(upgradedNodes);
}

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