Skip to content

Commit 737fb67

Browse files
committed
Merge remote-tracking branch 'upstream/main' into http-aggregator-removal
2 parents 7fcf9bb + 75c602d commit 737fb67

File tree

275 files changed

+7398
-4017
lines changed

Some content is hidden

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

275 files changed

+7398
-4017
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
steps:
2+
- label: pr-upgrade
3+
command: ".buildkite/scripts/run-pr-upgrade-tests.sh"
4+
agents:
5+
image: "docker.elastic.co/ci-agent-images/eck-region/buildkite-agent:1.5"
6+
memory: "4G"

.buildkite/scripts/release-tests.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ export BEATS_DIR=$(pwd)/distribution/docker/build/artifacts/beats
99
mkdir -p ${BEATS_DIR}
1010
curl --fail -o "${BEATS_DIR}/metricbeat-${ES_VERSION}-linux-x86_64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/metricbeat/metricbeat-${ES_VERSION}-SNAPSHOT-linux-x86_64.tar.gz
1111
curl --fail -o "${BEATS_DIR}/metricbeat-${ES_VERSION}-linux-arm64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/metricbeat/metricbeat-${ES_VERSION}-SNAPSHOT-linux-arm64.tar.gz
12-
curl --fail -o "${BEATS_DIR}/filebeat-${ES_VERSION}-linux-x86_64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/metricbeat/metricbeat-${ES_VERSION}-SNAPSHOT-linux-x86_64.tar.gz
12+
curl --fail -o "${BEATS_DIR}/metricbeat-fips-${ES_VERSION}-linux-x86_64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/metricbeat/metricbeat-fips-${ES_VERSION}-SNAPSHOT-linux-x86_64.tar.gz
13+
curl --fail -o "${BEATS_DIR}/metricbeat-fips-${ES_VERSION}-linux-arm64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/metricbeat/metricbeat-fips-${ES_VERSION}-SNAPSHOT-linux-arm64.tar.gz
14+
15+
curl --fail -o "${BEATS_DIR}/filebeat-${ES_VERSION}-linux-x86_64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/filebeat/filebeat-${ES_VERSION}-SNAPSHOT-linux-x86_64.tar.gz
1316
curl --fail -o "${BEATS_DIR}/filebeat-${ES_VERSION}-linux-arm64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/filebeat/filebeat-${ES_VERSION}-SNAPSHOT-linux-arm64.tar.gz
17+
curl --fail -o "${BEATS_DIR}/filebeat-fips-${ES_VERSION}-linux-x86_64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/filebeat/filebeat-fips-${ES_VERSION}-SNAPSHOT-linux-x86_64.tar.gz
18+
curl --fail -o "${BEATS_DIR}/filebeat-fips-${ES_VERSION}-linux-arm64.tar.gz" https://artifacts-snapshot.elastic.co/beats/${ES_VERSION}-SNAPSHOT/downloads/beats/filebeat/filebeat-fips-${ES_VERSION}-SNAPSHOT-linux-arm64.tar.gz
1419

1520
# Fetch ML artifacts
1621
export ML_IVY_REPO=$(mktemp -d)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5+
# or more contributor license agreements. Licensed under the "Elastic License
6+
# 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
7+
# Public License v 1"; you may not use this file except in compliance with, at
8+
# your election, the "Elastic License 2.0", the "GNU Affero General Public
9+
# License v3.0 only", or the "Server Side Public License, v 1".
10+
#
11+
12+
set -euo pipefail
13+
14+
if [[ -z "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" ]]; then
15+
echo "Not a pull request, skipping PR upgrade tests."
16+
exit 0
17+
fi
18+
19+
# Identify the merge base of the current commit (branch) and the base branch of the pull request.
20+
# PR upgrade tests are run from the merge base to the current commit.
21+
BASE_COMMIT=$(git merge-base $BUILDKITE_PULL_REQUEST_BASE_BRANCH $BUILDKITE_COMMIT)
22+
23+
VERSION=$(sed -n 's/^elasticsearch[[:space:]]*=[[:space:]]*\(.*\)/\1/p' build-tools-internal/version.properties)
24+
25+
echo "Running PR upgrade tests from $BUILDKITE_PULL_REQUEST_BASE_BRANCH [$BASE_COMMIT] to $BUILDKITE_BRANCH [$BUILDKITE_COMMIT]."
26+
27+
cat <<EOF | buildkite-agent pipeline upload
28+
steps:
29+
- label: pr-upgrade $BUILDKITE_PULL_REQUEST_BASE_BRANCH -> $BUILDKITE_BRANCH
30+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-file-fingerprints -Dtests.bwc.main.version=${VERSION}-SNAPSHOT -Dtests.bwc.refspec.main=${BASE_COMMIT} bcUpgradeTest -Dtests.jvm.argline="-Des.serverless_transport=true"
31+
timeout_in_minutes: 300
32+
agents:
33+
provider: gcp
34+
image: family/elasticsearch-ubuntu-2004
35+
machineType: n1-standard-32
36+
buildDirectory: /dev/shm/bk
37+
preemptible: true
38+
retry:
39+
automatic:
40+
- exit_status: "-1"
41+
limit: 3
42+
signal_reason: none
43+
- signal_reason: agent_stop
44+
limit: 3
45+
EOF
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "Docs preview comment"
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, synchronize]
6+
7+
permissions:
8+
contents: read
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
preview-links:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Comment preview links for changed docs
17+
uses: actions/github-script@v7
18+
with:
19+
github-token: ${{ secrets.GITHUB_TOKEN }}
20+
script: |
21+
const pr = context.payload.pull_request;
22+
const prNum = pr.number;
23+
const owner = context.repo.owner;
24+
const repo = context.repo.repo;
25+
const base = `https://docs-v3-preview.elastic.dev/${owner}/${repo}/pull/${prNum}`;
26+
// 1) List all files in this PR
27+
const { data: files } = await github.rest.pulls.listFiles({
28+
owner, repo, pull_number: prNum
29+
});
30+
// 2) Filter to only added/modified .md files (skip removed and _snippets/)
31+
const links = files
32+
.filter(f =>
33+
f.status !== 'removed' &&
34+
/\.md$/i.test(f.filename) &&
35+
!/(^|\/)_snippets\//i.test(f.filename)
36+
)
37+
.map(f => {
38+
let p = f.filename.replace(/\/index\.md$/i, '/');
39+
if (p === f.filename) p = p.replace(/\.md$/i, '');
40+
return `- [\`${f.filename}\`](${base}/${p})`;
41+
});
42+
if (!links.length) return; // nothing to do
43+
// 3) Build the comment body
44+
const body = [
45+
"🔍 **Preview links for changed docs:**",
46+
"",
47+
...links,
48+
"",
49+
"🔔 *The preview site may take up to **3 minutes** to finish building. These links will become live once it completes.*"
50+
].join("\n");
51+
// 4) Post or update a single bot comment
52+
const { data: comments } = await github.rest.issues.listComments({
53+
owner, repo, issue_number: prNum
54+
});
55+
const existing = comments.find(c =>
56+
c.user.type === 'Bot' &&
57+
c.body.startsWith("🔍 **Preview links for changed docs:**")
58+
);
59+
if (existing) {
60+
await github.rest.issues.updateComment({
61+
owner, repo,
62+
comment_id: existing.id,
63+
body
64+
});
65+
} else {
66+
await github.rest.issues.createComment({
67+
owner, repo,
68+
issue_number: prNum,
69+
body
70+
});
71+
}

benchmarks/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dependencies {
4141
}
4242
api(project(':libs:h3'))
4343
api(project(':modules:aggregations'))
44+
implementation project(':modules:mapper-extras');
4445
api(project(':x-pack:plugin:esql-core'))
4546
api(project(':x-pack:plugin:core'))
4647
api(project(':x-pack:plugin:esql'))

benchmarks/src/main/java/org/elasticsearch/benchmark/index/mapper/MapperServiceFactory.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.elasticsearch.index.mapper.ProvidedIdFieldMapper;
3030
import org.elasticsearch.index.similarity.SimilarityService;
3131
import org.elasticsearch.indices.IndicesModule;
32+
import org.elasticsearch.plugins.MapperPlugin;
3233
import org.elasticsearch.script.Script;
3334
import org.elasticsearch.script.ScriptCompiler;
3435
import org.elasticsearch.script.ScriptContext;
@@ -38,11 +39,16 @@
3839
import java.io.IOException;
3940
import java.io.UncheckedIOException;
4041
import java.util.Collections;
42+
import java.util.List;
4143
import java.util.Map;
4244

4345
public class MapperServiceFactory {
4446

4547
public static MapperService create(String mappings) {
48+
return create(mappings, Collections.emptyList());
49+
}
50+
51+
public static MapperService create(String mappings, List<MapperPlugin> mapperPlugins) {
4652
Settings settings = Settings.builder()
4753
.put("index.number_of_replicas", 0)
4854
.put("index.number_of_shards", 1)
@@ -51,7 +57,7 @@ public static MapperService create(String mappings) {
5157
.build();
5258
IndexMetadata meta = IndexMetadata.builder("index").settings(settings).build();
5359
IndexSettings indexSettings = new IndexSettings(meta, settings);
54-
MapperRegistry mapperRegistry = new IndicesModule(Collections.emptyList()).getMapperRegistry();
60+
MapperRegistry mapperRegistry = new IndicesModule(mapperPlugins).getMapperRegistry();
5561

5662
SimilarityService similarityService = new SimilarityService(indexSettings, null, Map.of());
5763
BitsetFilterCache bitsetFilterCache = new BitsetFilterCache(indexSettings, BitsetFilterCache.Listener.NOOP);

benchmarks/src/main/java/org/elasticsearch/benchmark/xcontent/OptimizedTextBenchmark.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.elasticsearch.common.logging.LogConfigurator;
1616
import org.elasticsearch.index.mapper.MapperService;
1717
import org.elasticsearch.index.mapper.SourceToParse;
18+
import org.elasticsearch.index.mapper.extras.MapperExtrasPlugin;
1819
import org.elasticsearch.xcontent.XContentBuilder;
1920
import org.elasticsearch.xcontent.XContentFactory;
2021
import org.elasticsearch.xcontent.XContentType;
@@ -34,6 +35,7 @@
3435
import org.openjdk.jmh.infra.Blackhole;
3536

3637
import java.io.IOException;
38+
import java.util.List;
3739
import java.util.Random;
3840
import java.util.concurrent.TimeUnit;
3941

@@ -66,7 +68,7 @@ public class OptimizedTextBenchmark {
6668
private SourceToParse[] sources;
6769

6870
private String randomValue(int length) {
69-
final String CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
71+
final String CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
7072
Random random = new Random();
7173
StringBuilder builder = new StringBuilder(length);
7274
for (int i = 0; i < length; i++) {
@@ -83,17 +85,17 @@ public void setup() throws IOException {
8385
"dynamic": false,
8486
"properties": {
8587
"field": {
86-
"type": "keyword"
88+
"type": "match_only_text"
8789
}
8890
}
8991
}
9092
}
91-
""");
93+
""", List.of(new MapperExtrasPlugin()));
9294

9395
sources = new SourceToParse[nDocs];
9496
for (int i = 0; i < nDocs; i++) {
9597
XContentBuilder b = XContentFactory.jsonBuilder();
96-
b.startObject().field("field", randomValue(8)).endObject();
98+
b.startObject().field("field", randomValue(512)).endObject();
9799
sources[i] = new SourceToParse(UUIDs.randomBase64UUID(), BytesReference.bytes(b), XContentType.JSON);
98100
}
99101
}

build-tools-internal/src/main/resources/forbidden/es-server-signatures.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ org.elasticsearch.cluster.ClusterFeatures#clusterHasFeature(org.elasticsearch.cl
160160

161161
@defaultMessage Do not construct this records outside the source files they are declared in
162162
org.elasticsearch.cluster.SnapshotsInProgress$ShardSnapshotStatus#<init>(java.lang.String, org.elasticsearch.cluster.SnapshotsInProgress$ShardState, org.elasticsearch.repositories.ShardGeneration, java.lang.String, org.elasticsearch.repositories.ShardSnapshotResult)
163-
org.elasticsearch.cluster.SnapshotDeletionsInProgress$Entry#<init>(java.lang.String, java.util.List, long, long, org.elasticsearch.cluster.SnapshotDeletionsInProgress$State, java.lang.String)
163+
org.elasticsearch.cluster.SnapshotDeletionsInProgress$Entry#<init>(org.elasticsearch.cluster.metadata.ProjectId, java.lang.String, java.util.List, long, long, org.elasticsearch.cluster.SnapshotDeletionsInProgress$State, java.lang.String)
164164

165165
@defaultMessage Use a Thread constructor with a name, anonymous threads are more difficult to debug
166166
java.lang.Thread#<init>(java.lang.Runnable)

docs/changelog/127636.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pr: 127636
2+
summary: Disallow mixed quoted/unquoted patterns in FROM
3+
area: ES|QL
4+
type: breaking
5+
issues:
6+
- 122651
7+
breaking:
8+
title: Disallow mixed quoted/unquoted patterns in FROM
9+
area: ES|QL
10+
details: "Previously, the ES|QL grammar allowed users to individually quote constituent strings in index patterns\
11+
\ such as \"remote_cluster\":\"index_name\". This would allow users to write complex malformed index patterns\
12+
\ that often slip through grammar and the subsequent validation. This could result in runtime errors\
13+
\ that can be misleading. This change simplifies the grammar to early reject such malformed index patterns\
14+
\ at the parsing stage, allowing users to write simpler queries and see more relevant and meaningful\
15+
\ errors."
16+
impact: "Users can write queries with simpler index patterns and see more meaningful and relevant errors."
17+
notable: false

docs/changelog/128361.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 128361
2+
summary: The follower index should wait until the time series end time passes before unfollowing the leader index.
3+
area: ILM+SLM
4+
type: bug
5+
issues:
6+
- 128129

0 commit comments

Comments
 (0)