Skip to content

Commit c87df56

Browse files
committed
Merge branch 'main' into feature/apis
2 parents e61f293 + 7b8f4fb commit c87df56

File tree

85 files changed

+1149
-378
lines changed

Some content is hidden

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

85 files changed

+1149
-378
lines changed

.buildkite/scripts/dra-workflow.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ echo --- Building release artifacts
7171
buildReleaseArtifacts \
7272
exportCompressedDockerImages \
7373
exportDockerContexts \
74+
:zipAggregation \
7475
:distribution:generateDependenciesReport
7576

7677
PATH="$PATH:${JAVA_HOME}/bin" # Required by the following script

build-tools-internal/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=d7042b3c11565c192041fc8c4703f541b888286404b4f267138c1d094d8ecdca
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-all.zip
3+
distributionSha256Sum=443c9c8ee2ac1ee0e11881a40f2376d79c66386264a44b24a9f8ca67e633375f
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

build-tools-internal/src/main/resources/changelog-schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"Rollup",
8787
"SQL",
8888
"Search",
89+
"Searchable Snapshots",
8990
"Security",
9091
"Snapshot/Restore",
9192
"Stats",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.14.1
1+
8.14.2

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ nmcpAggregation {
6868
}
6969

7070
tasks.named('zipAggregation').configure {
71+
// put this in a place that works well with our DRA infrastructure
72+
archiveFileName.unset();
73+
archiveBaseName.set("elasticsearch-maven-aggregation")
74+
archiveVersion.set(VersionProperties.elasticsearch)
75+
destinationDirectory.set(layout.buildDirectory.dir("distributions"));
76+
7177
dependsOn gradle.includedBuild('build-tools').task(':zipElasticPublication')
7278
from(zipTree(gradle.includedBuild('build-tools').task(':zipElasticPublication').resolveTask().archiveFile.get()))
7379
}

docs/changelog/128910.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 128910
2+
summary: Fix `FieldAttribute` name usage in `InferNonNullAggConstraint`
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/changelog/128913.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 128913
2+
summary: "[apm-data] Enable 'date_detection' for all apm data streams"
3+
area: Data streams
4+
type: enhancement
5+
issues: []

docs/changelog/129164.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 129164
2+
summary: Log partial failures
3+
area: ES|QL
4+
type: feature
5+
issues: []

docs/changelog/129245.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 129245
2+
summary: Throttle indexing when disk IO throttling is disabled
3+
area: Engine
4+
type: enhancement
5+
issues: []

docs/reference/query-languages/esql/_snippets/lists/search-functions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
* [preview] [`MATCH`](../../functions-operators/search-functions.md#esql-match)
33
* [preview] [`MATCH_PHRASE`](../../functions-operators/search-functions.md#esql-match_phrase)
44
* [preview] [`QSTR`](../../functions-operators/search-functions.md#esql-qstr)
5-
% * [preview] [
6-
`TERM`](../../functions-operators/search-functions.md#esql-term)
5+
% * [preview] [`TERM`](../../functions-operators/search-functions.md#esql-term)

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=d7042b3c11565c192041fc8c4703f541b888286404b4f267138c1d094d8ecdca
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-all.zip
3+
distributionSha256Sum=443c9c8ee2ac1ee0e11881a40f2376d79c66386264a44b24a9f8ca67e633375f
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,9 @@ tests:
520520
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeForkIT
521521
method: test {lookup-join.MultipleBatches*
522522
issue: https://github.com/elastic/elasticsearch/issues/129210
523+
- class: org.elasticsearch.compute.data.sort.LongTopNSetTests
524+
method: testCrankyBreaker
525+
issue: https://github.com/elastic/elasticsearch/issues/129257
523526

524527
# Examples:
525528
#

plugins/examples/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=d7042b3c11565c192041fc8c4703f541b888286404b4f267138c1d094d8ecdca
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-all.zip
3+
distributionSha256Sum=443c9c8ee2ac1ee0e11881a40f2376d79c66386264a44b24a9f8ca67e633375f
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/ParameterizedFullClusterRestartTestCase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ public boolean isRunningAgainstOldCluster() {
134134
return requestedUpgradeStatus == OLD;
135135
}
136136

137-
public static String getOldClusterVersion() {
137+
/**
138+
* The version of the "old" (initial) cluster. It is an opaque string, do not even think about parsing it for version
139+
* comparison. Use (test) cluster features and {@link ParameterizedFullClusterRestartTestCase#oldClusterHasFeature} instead.
140+
*/
141+
protected static String getOldClusterVersion() {
138142
return System.getProperty("tests.bwc.main.version", OLD_CLUSTER_VERSION);
139143
}
140144

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/AbstractRollingUpgradeTestCase.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ public abstract class AbstractRollingUpgradeTestCase extends ParameterizedRollin
3030
private static final ElasticsearchCluster cluster = buildCluster();
3131

3232
private static ElasticsearchCluster buildCluster() {
33-
Version oldVersion = Version.fromString(OLD_CLUSTER_VERSION);
33+
// Note we need to use OLD_CLUSTER_VERSION directly here, as it may contain special values (e.g. 0.0.0) the ElasticsearchCluster
34+
// builder uses to lookup a particular distribution
3435
var cluster = ElasticsearchCluster.local()
3536
.distribution(DistributionType.DEFAULT)
36-
.version(getOldClusterTestVersion())
37+
.version(OLD_CLUSTER_VERSION)
3738
.nodes(NODE_NUM)
3839
.setting("path.repo", new Supplier<>() {
3940
@Override
@@ -46,8 +47,9 @@ public String get() {
4647
.feature(FeatureFlag.TIME_SERIES_MODE);
4748

4849
// Avoid triggering bogus assertion when serialized parsed mappings don't match with original mappings, because _source key is
49-
// inconsistent
50-
if (oldVersion.before(Version.fromString("8.18.0"))) {
50+
// inconsistent. As usual, we operate under the premise that "versionless" clusters (serverless) are on the latest code and
51+
// do not need this.
52+
if (Version.tryParse(getOldClusterVersion()).map(v -> v.before(Version.fromString("8.18.0"))).orElse(false)) {
5153
cluster.jvmArg("-da:org.elasticsearch.index.mapper.DocumentMapper");
5254
cluster.jvmArg("-da:org.elasticsearch.index.mapper.MapperService");
5355
}

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/AbstractRollingUpgradeWithSecurityTestCase.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ public abstract class AbstractRollingUpgradeWithSecurityTestCase extends Paramet
3535
private static final ElasticsearchCluster cluster = buildCluster();
3636

3737
private static ElasticsearchCluster buildCluster() {
38-
Version oldVersion = Version.fromString(OLD_CLUSTER_VERSION);
38+
// Note we need to use OLD_CLUSTER_VERSION directly here, as it may contain special values (e.g. 0.0.0) the ElasticsearchCluster
39+
// builder uses to lookup a particular distribution
3940
var cluster = ElasticsearchCluster.local()
4041
.distribution(DistributionType.DEFAULT)
41-
.version(getOldClusterTestVersion())
42+
.version(OLD_CLUSTER_VERSION)
4243
.nodes(NODE_NUM)
4344
.user(USER, PASS)
4445
.setting("xpack.security.autoconfiguration.enabled", "false")
@@ -51,8 +52,8 @@ public String get() {
5152
});
5253

5354
// Avoid triggering bogus assertion when serialized parsed mappings don't match with original mappings, because _source key is
54-
// inconsistent
55-
if (oldVersion.before(Version.fromString("8.18.0"))) {
55+
// inconsistent. Assume non-parseable versions (serverless) do not need this.
56+
if (Version.tryParse(getOldClusterVersion()).map(v -> v.before(Version.fromString("8.18.0"))).orElse(false)) {
5657
cluster.jvmArg("-da:org.elasticsearch.index.mapper.DocumentMapper");
5758
cluster.jvmArg("-da:org.elasticsearch.index.mapper.MapperService");
5859
}

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/DenseVectorMappingUpdateIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public DenseVectorMappingUpdateIT(@Name("upgradedNodes") int upgradedNodes) {
8282
}
8383

8484
public void testDenseVectorMappingUpdateOnOldCluster() throws IOException {
85-
if (getOldClusterTestVersion().after(Version.V_8_7_0.toString())) {
85+
if (oldClusterHasFeature("gte_v8.7.1")) {
8686
String indexName = "test_index";
8787
if (isOldCluster()) {
8888
Request createIndex = new Request("PUT", "/" + indexName);

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsUpgradeIT.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.client.Request;
1515
import org.elasticsearch.common.xcontent.support.XContentMapValues;
1616
import org.elasticsearch.core.SuppressForbidden;
17+
import org.elasticsearch.core.UpdateForV10;
1718
import org.elasticsearch.test.cluster.ElasticsearchCluster;
1819
import org.elasticsearch.test.cluster.FeatureFlag;
1920
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
@@ -33,8 +34,12 @@
3334

3435
public class FileSettingsUpgradeIT extends ParameterizedRollingUpgradeTestCase {
3536

37+
@UpdateForV10(owner = UpdateForV10.Owner.CORE_INFRA) // Remove this rule entirely
3638
private static final RunnableTestRuleAdapter versionLimit = new RunnableTestRuleAdapter(
37-
() -> assumeTrue("Only valid when upgrading from pre-file settings", getOldClusterTestVersion().before(new Version(8, 4, 0)))
39+
() -> assumeTrue(
40+
"Only valid when upgrading from pre-file settings",
41+
Version.tryParse(getOldClusterVersion()).map(v -> v.before(new Version(8, 4, 0))).orElse(false)
42+
)
3843
);
3944

4045
private static final String settingsJSON = """
@@ -52,9 +57,11 @@ public class FileSettingsUpgradeIT extends ParameterizedRollingUpgradeTestCase {
5257

5358
private static final TemporaryFolder repoDirectory = new TemporaryFolder();
5459

60+
// Note we need to use OLD_CLUSTER_VERSION directly here, as it may contain special values (e.g. 0.0.0) the ElasticsearchCluster
61+
// builder uses to lookup a particular distribution
5562
private static final ElasticsearchCluster cluster = ElasticsearchCluster.local()
5663
.distribution(DistributionType.DEFAULT)
57-
.version(getOldClusterTestVersion())
64+
.version(OLD_CLUSTER_VERSION)
5865
.nodes(NODE_NUM)
5966
.setting("path.repo", new Supplier<>() {
6067
@Override

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/LogsUsageRollingUpgradeIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public LogsUsageRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
3030
}
3131

3232
public void testUsage() throws Exception {
33-
assumeTrue("logsdb.prior_logs_usage only gets set in 8.x", getOldClusterTestVersion().before("9.0.0"));
33+
assumeFalse("logsdb.prior_logs_usage only gets set in 8.x", oldClusterHasFeature("gte_v9.0.0"));
3434
String dataStreamName = "logs-mysql-error";
3535
if (isOldCluster()) {
3636
bulkIndex(dataStreamName, 4, 256, Instant.now());

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/ParameterizedRollingUpgradeTestCase.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ public static void resetNodes() {
127127
upgradeFailed = false;
128128
}
129129

130-
@Deprecated // Use the new testing framework and oldClusterHasFeature(feature) instead
131-
protected static String getOldClusterVersion() {
132-
return OLD_CLUSTER_VERSION;
133-
}
134-
135130
protected static boolean oldClusterHasFeature(String featureId) {
136131
assert oldClusterTestFeatureService != null;
137132
return oldClusterTestFeatureService.clusterHasFeature(featureId);
@@ -146,12 +141,20 @@ protected static IndexVersion getOldClusterIndexVersion() {
146141
return oldIndexVersion;
147142
}
148143

149-
protected static Version getOldClusterTestVersion() {
150-
return Version.fromString(OLD_CLUSTER_VERSION);
144+
/**
145+
* The version of the "old" (initial) cluster. It is an opaque string, do not even think about parsing it for version
146+
* comparison. Use (test) cluster features and {@link ParameterizedRollingUpgradeTestCase#oldClusterHasFeature} instead.
147+
*/
148+
protected static String getOldClusterVersion() {
149+
return System.getProperty("tests.bwc.main.version", OLD_CLUSTER_VERSION);
151150
}
152151

153-
protected static boolean isOldClusterVersion(String nodeVersion) {
154-
return OLD_CLUSTER_VERSION.equals(nodeVersion);
152+
protected static boolean isOldClusterVersion(String nodeVersion, String buildHash) {
153+
String bwcRefSpec = System.getProperty("tests.bwc.refspec.main");
154+
if (bwcRefSpec != null) {
155+
return bwcRefSpec.equals(buildHash);
156+
}
157+
return getOldClusterVersion().equals(nodeVersion);
155158
}
156159

157160
protected static boolean isOldCluster() {

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,22 @@ public void testSnapshotBasedRecovery() throws Exception {
8888
}
8989

9090
String primaryNodeId = getPrimaryNodeIdOfShard(indexName, 0);
91-
String primaryNodeVersion = getNodeVersion(primaryNodeId);
91+
var primaryNodeVersion = getNodeVersion(primaryNodeId);
9292

9393
// Sometimes the primary shard ends on the upgraded node (i.e. after a rebalance)
9494
// This causes issues when removing and adding replicas, since then we cannot allocate to any of the old nodes.
9595
// That is an issue only for the first mixed round.
9696
// In that case we exclude the upgraded node from the shard allocation and cancel the shard to force moving
9797
// the primary to a node in the old version, this allows adding replicas in the first mixed round.
9898
logger.info("--> Primary node in first mixed round {} / {}", primaryNodeId, primaryNodeVersion);
99-
if (isOldClusterVersion(primaryNodeVersion) == false) {
99+
if (isOldClusterVersion(primaryNodeVersion.version(), primaryNodeVersion.buildHash()) == false) {
100100
logger.info("--> cancelling primary shard on node [{}]", primaryNodeId);
101101
cancelShard(indexName, 0, primaryNodeId);
102102
logger.info("--> done cancelling primary shard on node [{}]", primaryNodeId);
103103

104104
String currentPrimaryNodeId = getPrimaryNodeIdOfShard(indexName, 0);
105-
assertTrue(isOldClusterVersion(getNodeVersion(currentPrimaryNodeId)));
105+
var currentPrimaryNodeVersion = getNodeVersion(currentPrimaryNodeId);
106+
assertTrue(isOldClusterVersion(currentPrimaryNodeVersion.version(), currentPrimaryNodeVersion.buildHash()));
106107
}
107108
} else {
108109
logger.info("--> not in first upgrade round, removing exclusions for [{}]", indexName);
@@ -137,17 +138,24 @@ private List<String> getUpgradedNodeIds() throws IOException {
137138
List<String> upgradedNodes = new ArrayList<>();
138139
for (Map.Entry<String, Map<String, Object>> nodeInfoEntry : nodes.entrySet()) {
139140
String nodeVersion = extractValue(nodeInfoEntry.getValue(), "version");
140-
if (isOldClusterVersion(nodeVersion) == false) {
141+
String nodeBuildHash = extractValue(nodeInfoEntry.getValue(), "build_hash");
142+
if (isOldClusterVersion(nodeVersion, nodeBuildHash) == false) {
141143
upgradedNodes.add(nodeInfoEntry.getKey());
142144
}
143145
}
144146
return upgradedNodes;
145147
}
146148

147-
private String getNodeVersion(String primaryNodeId) throws IOException {
149+
private record NodeVersion(String version, String buildHash) {}
150+
151+
private NodeVersion getNodeVersion(String primaryNodeId) throws IOException {
148152
Request request = new Request(HttpGet.METHOD_NAME, "_nodes/" + primaryNodeId);
149153
Response response = client().performRequest(request);
150-
return extractValue(responseAsMap(response), "nodes." + primaryNodeId + ".version");
154+
Map<String, Object> responseAsMap = responseAsMap(response);
155+
return new NodeVersion(
156+
extractValue(responseAsMap, "nodes." + primaryNodeId + ".version"),
157+
extractValue(responseAsMap, "nodes." + primaryNodeId + ".build_hash")
158+
);
151159
}
152160

153161
private String getPrimaryNodeIdOfShard(String indexName, int shard) throws Exception {

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/SourceModeRollingUpgradeIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public SourceModeRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
2727
}
2828

2929
public void testConfigureStoredSourceBeforeIndexCreationLegacy() throws IOException {
30-
assumeTrue("testing deprecation warnings and deprecation migrations", getOldClusterTestVersion().before("9.0.0"));
30+
assumeFalse("testing deprecation warnings and deprecation migrations", oldClusterHasFeature("gte_v9.0.0"));
3131
String templateName = "logs@custom";
3232
if (isOldCluster()) {
3333
var storedSourceMapping = """
@@ -56,7 +56,7 @@ public void testConfigureStoredSourceBeforeIndexCreationLegacy() throws IOExcept
5656
}
5757

5858
public void testConfigureStoredSourceWhenIndexIsCreatedLegacy() throws IOException {
59-
assumeTrue("testing deprecation warnings and deprecation migrations", getOldClusterTestVersion().before("9.0.0"));
59+
assumeFalse("testing deprecation warnings and deprecation migrations", oldClusterHasFeature("gte_v9.0.0"));
6060
String templateName = "logs@custom";
6161
if (isOldCluster()) {
6262
var storedSourceMapping = """

0 commit comments

Comments
 (0)