Skip to content

Commit 89749bb

Browse files
Merge pull request ESQL-608 from elastic/main
🤖 ESQL: Merge upstream
2 parents 980fb1b + 90f49de commit 89749bb

File tree

53 files changed

+1316
-653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1316
-653
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/testfixtures/TestFixturesPlugin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public void execute(Task task) {
117117
maybeSkipTask(dockerSupport, buildFixture);
118118

119119
ComposeExtension composeExtension = project.getExtensions().getByType(ComposeExtension.class);
120+
composeExtension.setProjectName(project.getName());
120121
composeExtension.getUseComposeFiles().addAll(Collections.singletonList(DOCKER_COMPOSE_YML));
121122
composeExtension.getRemoveContainers().set(true);
122123
composeExtension.getCaptureContainersOutput()

distribution/docker/build.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import org.elasticsearch.gradle.internal.docker.DockerSupportPlugin
88
import org.elasticsearch.gradle.internal.docker.DockerSupportService
99
import org.elasticsearch.gradle.internal.docker.ShellRetry
1010
import org.elasticsearch.gradle.internal.docker.TransformLog4jConfigFilter
11-
import org.elasticsearch.gradle.internal.dra.DraResolvePlugin
1211
import org.elasticsearch.gradle.internal.info.BuildParams
1312
import org.elasticsearch.gradle.util.GradleUtils
1413

@@ -75,11 +74,12 @@ configurations {
7574
log4jConfig
7675
tini
7776
allPlugins
78-
filebeat
79-
metricbeat
77+
filebeat_aarch64
78+
filebeat_x86_64
79+
metricbeat_aarch64
80+
metricbeat_x86_64
8081
}
8182

82-
String beatsArch = Architecture.current() == Architecture.AARCH64 ? 'arm64' : 'x86_64'
8383
String tiniArch = Architecture.current() == Architecture.AARCH64 ? 'arm64' : 'amd64'
8484

8585
dependencies {
@@ -88,8 +88,10 @@ dependencies {
8888
log4jConfig project(path: ":distribution", configuration: 'log4jConfig')
8989
tini "krallin:tini:0.19.0:${tiniArch}"
9090
allPlugins project(path: ':plugins', configuration: 'allPlugins')
91-
filebeat "beats:filebeat:${VersionProperties.elasticsearch}:linux-${beatsArch}@tar.gz"
92-
metricbeat "beats:metricbeat:${VersionProperties.elasticsearch}:linux-${beatsArch}@tar.gz"
91+
filebeat_aarch64 "beats:filebeat:${VersionProperties.elasticsearch}:[email protected]"
92+
filebeat_x86_64 "beats:filebeat:${VersionProperties.elasticsearch}:[email protected]"
93+
metricbeat_aarch64 "beats:metricbeat:${VersionProperties.elasticsearch}:[email protected]"
94+
metricbeat_x86_64 "beats:metricbeat:${VersionProperties.elasticsearch}:[email protected]"
9395
}
9496

9597
ext.expansions = { Architecture architecture, DockerBase base ->
@@ -273,8 +275,8 @@ void addBuildDockerContextTask(Architecture architecture, DockerBase base) {
273275
boolean includeBeats = VersionProperties.isElasticsearchSnapshot() == true || buildId != null || useDra
274276

275277
if (includeBeats) {
276-
from configurations.filebeat
277-
from configurations.metricbeat
278+
from configurations.getByName("filebeat_${architecture.classifier}")
279+
from configurations.getByName("metricbeat_${architecture.classifier}")
278280
}
279281
// For some reason, the artifact name can differ depending on what repository we used.
280282
rename ~/((?:file|metric)beat)-.*\.tar\.gz$/, "\$1-${VersionProperties.elasticsearch}.tar.gz"
@@ -548,5 +550,5 @@ subprojects { Project subProject ->
548550

549551
tasks.named('resolveAllDependencies') {
550552
// Don't try and resolve filebeat or metricbeat snapshots as they may not always be available
551-
configs = configurations.matching { it.name.endsWith('beat') == false }
553+
configs = configurations.matching { it.name.contains('beat') == false }
552554
}

docs/changelog/92856.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 92856
2+
summary: Don't announce ready until file settings are applied
3+
area: Infra/Core
4+
type: bug
5+
issues:
6+
- 92812

docs/reference/ml/anomaly-detection/apis/get-record.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ reduced. If the bucket contains fewer samples than expected, the score is reduce
135135
`lower_confidence_bound`::::
136136
(Optional, double) Lower bound of the 95% confidence interval.
137137
138+
`multimodal_distribution`::::
139+
(Optional, boolean) Indicates whether the bucket values' probability distribution has
140+
several modes. When there are multiple modes, the typical value may not be the most
141+
likely.
142+
138143
`multi_bucket_impact`::::
139144
(Optional, integer) Impact of the deviation between actual and typical values in the
140145
past 12 buckets.

libs/plugin-scanner/src/test/java/org/elasticsearch/plugin/scanner/ClassReadersTests.java

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

99
package org.elasticsearch.plugin.scanner;
1010

11+
import org.elasticsearch.core.IOUtils;
1112
import org.elasticsearch.test.ESTestCase;
1213
import org.elasticsearch.test.compiler.InMemoryJavaCompiler;
1314
import org.elasticsearch.test.jar.JarUtils;
@@ -39,6 +40,9 @@ public void testModuleInfoIsNotReturnedAsAClassFromJar() throws IOException {
3940

4041
List<ClassReader> classReaders = ClassReaders.ofPaths(Stream.of(jar));
4142
org.hamcrest.MatcherAssert.assertThat(classReaders, Matchers.empty());
43+
44+
// aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
45+
IOUtils.rm(tmp);
4246
}
4347

4448
public void testTwoClassesInAStreamFromJar() throws IOException {
@@ -57,6 +61,9 @@ public class B {}
5761
List<ClassReader> classReaders = ClassReaders.ofPaths(Stream.of(jar));
5862
List<String> collect = classReaders.stream().map(cr -> cr.getClassName()).collect(Collectors.toList());
5963
org.hamcrest.MatcherAssert.assertThat(collect, Matchers.containsInAnyOrder("p/A", "p/B"));
64+
65+
// aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
66+
IOUtils.rm(tmp);
6067
}
6168

6269
public void testStreamOfJarsAndIndividualClasses() throws IOException {

libs/plugin-scanner/src/test/java/org/elasticsearch/plugin/scanner/NamedComponentScannerTests.java

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

99
package org.elasticsearch.plugin.scanner;
1010

11+
import org.elasticsearch.core.IOUtils;
1112
import org.elasticsearch.plugin.scanner.test_model.ExtensibleClass;
1213
import org.elasticsearch.plugin.scanner.test_model.ExtensibleInterface;
1314
import org.elasticsearch.plugin.scanner.test_model.TestNamedComponent;
@@ -100,6 +101,9 @@ public class B implements ExtensibleInterface{}
100101
)
101102
)
102103
);
104+
105+
// aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
106+
IOUtils.rm(tmp);
103107
}
104108

105109
public void testNamedComponentsCanExtednCommonSuperClass() throws IOException {
@@ -174,6 +178,9 @@ public class B implements CustomExtensibleInterface{}
174178
)
175179
)
176180
);
181+
182+
// aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
183+
IOUtils.rm(tmp);
177184
}
178185

179186
public void testWriteToFile() throws IOException {

modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ public void testRandomDataSteamAliasesUpdate() throws Exception {
806806
String alias = randomAlphaOfLength(4);
807807
String[] dataStreams = Arrays.stream(generateRandomStringArray(16, 4, false, false))
808808
.map(s -> "log-" + s.toLowerCase(Locale.ROOT))
809+
.distinct()
809810
.toArray(String[]::new);
810811
for (String dataStream : dataStreams) {
811812
CreateDataStreamAction.Request createDataStreamRequest = new CreateDataStreamAction.Request(dataStream);

qa/smoke-test-multinode/src/yamlRestTest/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,20 @@
1818
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
1919
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
2020
import org.junit.ClassRule;
21-
import org.junit.rules.RuleChain;
22-
import org.junit.rules.TemporaryFolder;
23-
import org.junit.rules.TestRule;
2421

2522
@TimeoutSuite(millis = 40 * TimeUnits.MINUTE) // some of the windows test VMs are slow as hell
2623
public class SmokeTestMultiNodeClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
2724

28-
private static TemporaryFolder repoDirectory = new TemporaryFolder();
29-
30-
private static ElasticsearchCluster cluster = ElasticsearchCluster.local()
25+
@ClassRule
26+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
3127
.nodes(2)
3228
.module("mapper-extras")
3329
.module("ingest-common")
34-
.setting("path.repo", () -> repoDirectory.getRoot().getPath())
3530
// The first node does not have the ingest role so we're sure ingest requests are forwarded:
3631
.node(0, n -> n.setting("node.roles", "[master,data,ml,remote_cluster_client,transform]"))
3732
.feature(FeatureFlag.TIME_SERIES_MODE)
3833
.build();
3934

40-
@ClassRule
41-
// Ensure the shared repo dir is created before cluster start
42-
public static TestRule ruleChain = RuleChain.outerRule(repoDirectory).around(cluster);
43-
4435
public SmokeTestMultiNodeClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
4536
super(testCandidate);
4637
}

server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/ShardRoutingRoleIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ public AllocationCommand getCancelPrimaryCommand() {
356356
return null;
357357
}
358358

359+
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/93010")
359360
public void testSearchRouting() throws InterruptedException {
360361

361362
var routingTableWatcher = new RoutingTableWatcher();

server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestFileSettingsIT.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.elasticsearch.cluster.metadata.ReservedStateMetadata;
2121
import org.elasticsearch.cluster.service.ClusterService;
2222
import org.elasticsearch.common.bytes.BytesReference;
23-
import org.elasticsearch.common.settings.Settings;
2423
import org.elasticsearch.core.Strings;
2524
import org.elasticsearch.core.Tuple;
2625
import org.elasticsearch.plugins.Plugin;
@@ -51,11 +50,6 @@
5150

5251
public class IngestFileSettingsIT extends ESIntegTestCase {
5352

54-
@Override
55-
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
56-
return applyWorkaroundForIssue92812(super.nodeSettings(nodeOrdinal, otherSettings));
57-
}
58-
5953
@Override
6054
protected Collection<Class<? extends Plugin>> nodePlugins() {
6155
return Arrays.asList(CustomIngestTestPlugin.class);
@@ -107,7 +101,7 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
107101
"ingest_pipelines": {
108102
"my_ingest_pipeline": {
109103
"description": "_description",
110-
"processors": [
104+
"processors":
111105
{
112106
"foo" : {
113107
"field": "pipeline",
@@ -210,11 +204,11 @@ public void clusterChanged(ClusterChangedEvent event) {
210204
clusterService.removeListener(this);
211205
metadataVersion.set(event.state().metadata().version());
212206
savedClusterState.countDown();
213-
assertEquals(ReservedStateErrorMetadata.ErrorKind.VALIDATION, reservedState.errorMetadata().errorKind());
207+
assertEquals(ReservedStateErrorMetadata.ErrorKind.PARSING, reservedState.errorMetadata().errorKind());
214208
assertThat(reservedState.errorMetadata().errors(), allOf(notNullValue(), hasSize(1)));
215209
assertThat(
216210
reservedState.errorMetadata().errors().get(0),
217-
containsString("org.elasticsearch.ElasticsearchParseException: No processor type exists with name [foo]")
211+
containsString("org.elasticsearch.xcontent.XContentParseException: [17:16] [reserved_state_chunk] failed")
218212
);
219213
}
220214
}

0 commit comments

Comments
 (0)