Skip to content

Commit

Permalink
Merge branch '8.x' into backport/8.x/pr-116056
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Nov 5, 2024
2 parents 9ad5b1b + 4764c35 commit d79c197
Show file tree
Hide file tree
Showing 206 changed files with 3,735 additions and 1,642 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ private void registerAndConfigureDistributionArchivesExtension(Project project)
sub.getArtifacts().add(DEFAULT_CONFIGURATION_NAME, distributionArchive.getArchiveTask());
var extractedConfiguration = sub.getConfigurations().create(EXTRACTED_CONFIGURATION_NAME);
extractedConfiguration.setCanBeResolved(false);
extractedConfiguration.setCanBeConsumed(true);
extractedConfiguration.getAttributes()
.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE);
sub.getArtifacts().add(EXTRACTED_CONFIGURATION_NAME, distributionArchive.getExpandedDistTask());
// The "composite" configuration is specifically used for resolving transformed artifacts in an included build
var compositeConfiguration = sub.getConfigurations().create(COMPOSITE_CONFIGURATION_NAME);
compositeConfiguration.setCanBeResolved(false);
compositeConfiguration.setCanBeConsumed(true);
compositeConfiguration.getAttributes()
.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE);
compositeConfiguration.getAttributes().attribute(Attribute.of("composite", Boolean.class), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":plugins:repository-hdfs");
map.put(LegacyRestTestBasePlugin.class, ":plugins:store-smb");
map.put(LegacyRestTestBasePlugin.class, ":qa:ccs-rolling-upgrade-remote-cluster");
map.put(LegacyRestTestBasePlugin.class, ":qa:ccs-unavailable-clusters");
map.put(LegacyRestTestBasePlugin.class, ":qa:logging-config");
map.put(LegacyRestTestBasePlugin.class, ":qa:mixed-cluster");
map.put(LegacyRestTestBasePlugin.class, ":qa:multi-cluster-search");
map.put(LegacyRestTestBasePlugin.class, ":qa:remote-clusters");
Expand All @@ -65,15 +63,13 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-ingest-with-all-dependencies");
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-plugins");
map.put(LegacyRestTestBasePlugin.class, ":qa:system-indices");
map.put(LegacyRestTestBasePlugin.class, ":qa:unconfigured-node-name");
map.put(LegacyRestTestBasePlugin.class, ":qa:verify-version-constants");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-apm-integration");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-delayed-aggs");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-die-with-dignity");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-error-query");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-latency-simulating-directory");
map.put(LegacyRestTestBasePlugin.class, ":test:yaml-rest-runner");
map.put(LegacyRestTestBasePlugin.class, ":distribution:archives:integ-test-zip");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:core");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ent-search");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:fleet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.elasticsearch.gradle.Version;
import org.elasticsearch.gradle.VersionProperties;
import org.elasticsearch.gradle.distribution.ElasticsearchDistributionTypes;
import org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin;
import org.elasticsearch.gradle.internal.ElasticsearchJavaBasePlugin;
import org.elasticsearch.gradle.internal.InternalDistributionDownloadPlugin;
import org.elasticsearch.gradle.internal.info.BuildParams;
import org.elasticsearch.gradle.internal.test.ErrorReportingTestListener;
Expand Down Expand Up @@ -89,7 +89,7 @@ public RestTestBasePlugin(ProviderFactory providerFactory) {

@Override
public void apply(Project project) {
project.getPluginManager().apply(ElasticsearchJavaPlugin.class);
project.getPluginManager().apply(ElasticsearchJavaBasePlugin.class);
project.getPluginManager().apply(InternalDistributionDownloadPlugin.class);

// Register integ-test and default distributions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public void apply(Project project) {
private void setupDistributionContainer(Project project) {
distributionsContainer = project.container(ElasticsearchDistribution.class, name -> {
var fileConfiguration = project.getConfigurations().create(DISTRO_CONFIG_PREFIX + name);
fileConfiguration.setCanBeConsumed(false);
var extractedConfiguration = project.getConfigurations().create(DISTRO_EXTRACTED_CONFIG_PREFIX + name);
extractedConfiguration.setCanBeConsumed(false);
extractedConfiguration.getAttributes()
.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE);
var distribution = new ElasticsearchDistribution(
Expand Down
18 changes: 1 addition & 17 deletions distribution/archives/integ-test-zip/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import org.apache.tools.ant.filters.ReplaceTokens

apply plugin: 'elasticsearch.legacy-java-rest-test'
apply plugin: 'elasticsearch.internal-java-rest-test'

// The integ-test-distribution is published to maven
apply plugin: 'elasticsearch.publish'
Expand All @@ -35,19 +35,3 @@ publishing {
}
}
}

tasks.named("javaRestTest").configure {
dependsOn "assemble"
/*
* There are two unique things going on here:
* 1. These tests can be run against an external cluster with
* -Dtests.rest.cluster=whatever and -Dtest.cluster=whatever
* 2. *One* of these tests is incompatible with that and should be skipped
* when running against an external cluster.
*/
if (project.providers.systemProperty("tests.rest.cluster").isPresent()) {
nonInputProperties.systemProperty 'tests.logfile', testClusters.named('javaRestTest').map(c -> c.singleNode().serverLog)
} else {
systemProperty 'tests.logfile', '--external--'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.junit.ClassRule;

import java.io.IOException;

Expand All @@ -23,6 +25,14 @@
*/
public class CreatedLocationHeaderIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

public void testCreate() throws IOException {
locationTestCase("PUT", "test/_doc/1");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@
package org.elasticsearch.test.rest;

import org.elasticsearch.common.logging.JsonLogsIntegTestCase;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.LogType;
import org.hamcrest.Matcher;
import org.junit.ClassRule;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.io.InputStream;

import static org.hamcrest.Matchers.is;

public class JsonLogsFormatAndParseIT extends JsonLogsIntegTestCase {

private static final String NODE_NAME = "test-node-0";

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.withNode(localNodeSpecBuilder -> localNodeSpecBuilder.name(NODE_NAME))
.build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

@Override
protected Matcher<String> nodeNameMatcher() {
return is("integTest-0");
return is(NODE_NAME);
}

@Override
protected BufferedReader openReader(Path logFile) {
assumeFalse(
"Skipping test because it is being run against an external cluster.",
logFile.getFileName().toString().equals("--external--")
);
return AccessController.doPrivileged((PrivilegedAction<BufferedReader>) () -> {
try {
return Files.newBufferedReader(logFile, StandardCharsets.UTF_8);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
protected InputStream openLogsStream() {
return cluster.getNodeLog(0, LogType.SERVER_JSON);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import org.elasticsearch.common.Strings;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.junit.ClassRule;

import java.io.IOException;
import java.util.Collections;
Expand All @@ -28,6 +30,14 @@

public class NodeRestUsageIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

@SuppressWarnings("unchecked")
public void testWithRestUsage() throws IOException {
// First get the current usage figures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@

import org.elasticsearch.client.Request;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.junit.ClassRule;

import java.io.IOException;

import static org.hamcrest.CoreMatchers.containsString;

public class RequestsWithoutContentIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

public void testIndexMissingBody() throws IOException {
ResponseException responseException = expectThrows(
ResponseException.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.client.ResponseListener;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;

import java.io.IOException;
import java.util.Map;
Expand All @@ -32,6 +34,15 @@
* Tests that wait for refresh is fired if the index is closed.
*/
public class WaitForRefreshAndCloseIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

@Before
public void setupIndex() throws IOException {
Request request = new Request("PUT", "/test");
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog/114227.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 114227
summary: Ignore conflicting fields during dynamic mapping update
area: Mapping
type: bug
issues:
- 114228
5 changes: 5 additions & 0 deletions docs/changelog/115807.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 115807
summary: "[Inference API] Improve chunked results error message"
area: Machine Learning
type: enhancement
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/116015.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 116015
summary: Empty percentile results no longer throw no_such_element_exception in Anomaly Detection jobs
area: Machine Learning
type: bug
issues:
- 116013
6 changes: 6 additions & 0 deletions docs/changelog/116031.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 116031
summary: Resolve pipelines from template on lazy rollover write
area: Data streams
type: bug
issues:
- 112781
6 changes: 6 additions & 0 deletions docs/changelog/116086.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 116086
summary: "ESQL: Fix DEBUG log of filter"
area: ES|QL
type: bug
issues:
- 116055
6 changes: 6 additions & 0 deletions docs/changelog/116212.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 116212
summary: Handle status code 0 in S3 CMU response
area: Snapshot/Restore
type: bug
issues:
- 102294
6 changes: 6 additions & 0 deletions docs/changelog/116219.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 116219
summary: "[apm-data] Apply lazy rollover on index template creation"
area: Data streams
type: bug
issues:
- 116230

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/esql/functions/signature/match.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion docs/reference/modules/indices/circuit_breaker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
=== Circuit breaker settings
[[circuit-breaker-description]]
// tag::circuit-breaker-description-tag[]
{es} contains multiple circuit breakers used to prevent operations from causing an OutOfMemoryError. Each breaker specifies a limit for how much memory it can use. Additionally, there is a parent-level breaker that specifies the total amount of memory that can be used across all breakers.
{es} contains multiple circuit breakers used to prevent operations from using an excessive amount of memory. Each breaker tracks the memory
used by certain operations and specifies a limit for how much memory it may track. Additionally, there
is a parent-level breaker that specifies the total amount of memory that may be tracked across all breakers.

When a circuit breaker reaches its limit, {es} will reject further operations. See <<circuit-breaker-errors>> for information about errors
raised by circuit breakers.

Circuit breakers do not track all memory usage in {es} and therefore provide only incomplete protection against excessive memory usage. If
{es} uses too much memory then it may suffer from performance issues and nodes may even fail with an `OutOfMemoryError`. See
<<high-jvm-memory-pressure>> for help with troubleshooting high heap usage.

Except where noted otherwise, these settings can be dynamically updated on a
live cluster with the <<cluster-update-settings,cluster-update-settings>> API.
Expand Down
13 changes: 10 additions & 3 deletions docs/reference/query-dsl/script-score-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,17 @@ multiplied by `boost` to produce final documents' scores. Defaults to `1.0`.
===== Use relevance scores in a script

Within a script, you can
{ref}/modules-scripting-fields.html#scripting-score[access]
{ref}/modules-scripting-fields.html#scripting-score[access]
the `_score` variable which represents the current relevance score of a
document.

[[script-score-access-term-statistics]]
===== Use term statistics in a script

Within a script, you can
{ref}/modules-scripting-fields.html#scripting-term-statistics[access]
the `_termStats` variable which provides statistical information about the terms used in the child query of the `script_score` query.

[[script-score-predefined-functions]]
===== Predefined functions
You can use any of the available {painless}/painless-contexts.html[painless
Expand Down Expand Up @@ -147,7 +154,7 @@ updated since update operations also update the value of the `_seq_no` field.

[[decay-functions-numeric-fields]]
====== Decay functions for numeric fields
You can read more about decay functions
You can read more about decay functions
{ref}/query-dsl-function-score-query.html#function-decay[here].

* `double decayNumericLinear(double origin, double scale, double offset, double decay, double docValue)`
Expand Down Expand Up @@ -233,7 +240,7 @@ The `script_score` query calculates the score for
every matching document, or hit. There are faster alternative query types that
can efficiently skip non-competitive hits:

* If you want to boost documents on some static fields, use the
* If you want to boost documents on some static fields, use the
<<query-dsl-rank-feature-query, `rank_feature`>> query.
* If you want to boost documents closer to a date or geographic point, use the
<<query-dsl-distance-feature-query, `distance_feature`>> query.
Expand Down
Loading

0 comments on commit d79c197

Please sign in to comment.