Skip to content

Fix LogsIndexModeFullClusterRestartIT #111362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 29, 2024
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
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ tests:
- class: org.elasticsearch.action.admin.indices.create.SplitIndexIT
method: testSplitIndexPrimaryTerm
issue: https://github.com/elastic/elasticsearch/issues/111282
- class: org.elasticsearch.upgrades.LogsIndexModeFullClusterRestartIT
method: testLogsIndexing {cluster=UPGRADED}
issue: https://github.com/elastic/elasticsearch/issues/111306
- class: org.elasticsearch.xpack.ml.integration.DatafeedJobsRestIT
issue: https://github.com/elastic/elasticsearch/issues/111319
- class: org.elasticsearch.xpack.esql.analysis.VerifierTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.elasticsearch.test.MapMatcher;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.elasticsearch.test.rest.RestTestLegacyFeatures;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.junit.ClassRule;
Expand All @@ -37,14 +38,14 @@ public class LogsIndexModeFullClusterRestartIT extends ParameterizedFullClusterR
@ClassRule
public static final ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.version(getOldClusterTestVersion())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main fix.

.module("constant-keyword")
.module("data-streams")
.module("mapper-extras")
.module("x-pack-aggregate-metric")
.module("x-pack-stack")
.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.setting("cluster.logsdb.enabled", "true")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need this because we explicitly set index mode in the template. And this setting does not exist in old clusters.

.build();

public LogsIndexModeFullClusterRestartIT(@Name("cluster") FullClusterRestartUpgradeStatus upgradeStatus) {
Expand Down Expand Up @@ -123,6 +124,8 @@ protected ElasticsearchCluster getUpgradeCluster() {
}""";

public void testLogsIndexing() throws IOException {
assumeTrue("Test uses data streams", oldClusterHasFeature(RestTestLegacyFeatures.DATA_STREAMS_SUPPORTED));

if (isRunningAgainstOldCluster()) {
assertOK(client().performRequest(putTemplate(client(), "logs-template", STANDARD_TEMPLATE)));
assertOK(client().performRequest(createDataStream("logs-apache-production")));
Expand Down