Skip to content

Commit e592105

Browse files
authored
Merge branch 'main' into stateless-migrate-shards-availability-health-indicator
2 parents 59b0a3b + e81b7ea commit e592105

File tree

669 files changed

+21673
-17273
lines changed

Some content is hidden

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

669 files changed

+21673
-17273
lines changed

.buildkite/pull-requests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"admin",
99
"write"
1010
],
11-
"allowed_list": ["elastic-renovate-prod[bot]"],
11+
"allowed_list": ["elastic-renovate-prod[bot]", "github-actions[bot]"],
1212
"set_commit_status": false,
1313
"build_on_commit": true,
1414
"build_on_comment": true,

.buildkite/scripts/dra-update-staging.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source .buildkite/scripts/branches.sh
66

77
for BRANCH in "${BRANCHES[@]}"; do
88
# Don't publish main branch to staging
9-
if [[ "$BRANCH" == "main" ]]; then
9+
if [[ "$BRANCH" == "main" || "$BRANCH" == "7.17" ]]; then
1010
continue
1111
fi
1212

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
config:
22
- path: distribution/docker/src/docker/iron_bank
33
dockerfile: ../dockerfiles/ironbank/Dockerfile
4+
5+
pull_request:
6+
labels:
7+
- ":Delivery/Tooling"
8+
- ":Delivery/Packaging"
9+
- "auto-merge-without-approval"
10+
- "dependencies"
11+
- ">non-issue"
12+

.github/updatecli/values.d/scm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ scm:
22
enabled: true
33
owner: elastic
44
repository: elasticsearch
5-
branch: main
5+
branch: "main" # this value is overwritten by the GH workflow to match current branch
66
commitusingapi: true
77
# begin updatecli-compose policy values
88
user: elasticmachine
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
spec:
22
files:
3-
- "updatecli-compose.yaml"
3+
- "updatecli-compose.yaml"
4+
5+
labels:
6+
- ":Delivery/Tooling"
7+
- "auto-merge-without-approval"
8+
- "dependencies"
9+
- ">non-issue"

.github/workflows/updatecli-compose.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,38 @@ permissions:
1010
contents: read
1111

1212
jobs:
13+
setup-matrix:
14+
if: github.repository == 'elastic/elasticsearch'
15+
runs-on: ubuntu-latest
16+
outputs:
17+
branches: ${{ steps.set-matrix.outputs.matrix }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- id: set-matrix
21+
run: |
22+
BRANCHES=$(jq -c '[.branches[].branch]' branches.json)
23+
echo "matrix=$BRANCHES" >> $GITHUB_OUTPUT
24+
1325
compose:
26+
needs: setup-matrix
1427
if: github.repository == 'elastic/elasticsearch'
1528
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
branch: ${{ fromJson(needs.setup-matrix.outputs.branches) }}
1633
permissions:
1734
contents: write
1835
packages: read
1936
pull-requests: write
2037
steps:
2138
- uses: actions/checkout@v4
39+
with:
40+
ref: ${{ matrix.branch }}
41+
42+
- name: Update branch in SCM values
43+
run: |
44+
yq eval '.scm.branch = "${{ matrix.branch }}"' -i .github/updatecli/values.d/scm.yml
2245
2346
- uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
2447
with:
@@ -28,12 +51,7 @@ jobs:
2851

2952
- uses: elastic/oblt-actions/updatecli/run@v1
3053
with:
31-
command: --experimental compose diff
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
35-
- uses: elastic/oblt-actions/updatecli/run@v1
36-
with:
37-
command: --experimental compose apply
54+
# Runs in "--debug" mode to provide logs if the PR creation fails
55+
command: --experimental compose apply --debug
3856
env:
3957
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ testfixtures_shared/
7373
# Generated
7474
checkstyle_ide.xml
7575
x-pack/plugin/esql/src/main/generated-src/generated/
76+
x-pack/plugin/esql/src/test/resources/org/elasticsearch/xpack/esql/**/golden_tests/**/*.actual
77+
7678
server/src/main/resources/transport/definitions/manifest.txt
7779

7880
# JEnv

benchmarks/src/main/java/org/elasticsearch/benchmark/_nightly/esql/ValuesSourceReaderBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ private static BlockLoader numericBlockLoader(WhereAndBaseName w, NumberFieldMap
307307
@OperationsPerInvocation(INDEX_SIZE)
308308
public void benchmark() {
309309
ValuesSourceReaderOperator op = new ValuesSourceReaderOperator(
310-
new DriverContext(BigArrays.NON_RECYCLING_INSTANCE, blockFactory),
310+
new DriverContext(BigArrays.NON_RECYCLING_INSTANCE, blockFactory, null),
311311
ByteSizeValue.ofMb(1).getBytes(),
312312
fields(name),
313313
new IndexedByShardIdFromSingleton<>(new ValuesSourceReaderOperator.ShardContext(reader, (sourcePaths) -> {
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.benchmark.bytes;
11+
12+
import org.apache.lucene.util.BytesRef;
13+
import org.elasticsearch.common.io.stream.RecyclerBytesStreamOutput;
14+
import org.elasticsearch.common.recycler.Recycler;
15+
import org.openjdk.jmh.annotations.Benchmark;
16+
import org.openjdk.jmh.annotations.BenchmarkMode;
17+
import org.openjdk.jmh.annotations.Fork;
18+
import org.openjdk.jmh.annotations.Level;
19+
import org.openjdk.jmh.annotations.Measurement;
20+
import org.openjdk.jmh.annotations.Mode;
21+
import org.openjdk.jmh.annotations.OperationsPerInvocation;
22+
import org.openjdk.jmh.annotations.OutputTimeUnit;
23+
import org.openjdk.jmh.annotations.Scope;
24+
import org.openjdk.jmh.annotations.Setup;
25+
import org.openjdk.jmh.annotations.State;
26+
import org.openjdk.jmh.annotations.Warmup;
27+
28+
import java.io.IOException;
29+
import java.util.concurrent.ThreadLocalRandom;
30+
import java.util.concurrent.TimeUnit;
31+
32+
@BenchmarkMode(Mode.Throughput)
33+
@Warmup(time = 1)
34+
@Measurement(time = 1)
35+
@OutputTimeUnit(TimeUnit.MICROSECONDS)
36+
@State(Scope.Thread)
37+
@Fork(1)
38+
public class RecyclerBytesStreamOutputWriteBenchmark {
39+
40+
// large enough to negate stream reset
41+
// and not too large to stay under stream limit of 2GB on worst case (5 bytes vint)
42+
private static final int WRITES_PER_ITERATION = 400_000;
43+
private static final int RANDOM_NUMS_PER_ITERATION = 1000;
44+
private static final int PAGE_SIZE = 16384;
45+
46+
private ThreadLocalRandom random = ThreadLocalRandom.current();
47+
private int[] vint1Byte;
48+
private int[] vint2Bytes;
49+
private int[] vint3Bytes;
50+
private int[] vint4Bytes;
51+
private int[] vint5Bytes;
52+
private int[] vintNegBytes;
53+
private RecyclerBytesStreamOutput output = new RecyclerBytesStreamOutput(new SinglePageStream());
54+
55+
private int randomVInt(int vIntByteSize, boolean isNeg) {
56+
return (isNeg ? -1 : 1) * switch (vIntByteSize) {
57+
case 1 -> random.nextInt(0, 1 << 7);
58+
case 2 -> random.nextInt(1 << 7, 1 << 14);
59+
case 3 -> random.nextInt(1 << 14, 1 << 21);
60+
case 4 -> random.nextInt(1 << 21, 1 << 28);
61+
case 5 -> random.nextInt(1 << 28, 1 << 30);
62+
default -> throw new IllegalArgumentException("number of bytes must be between 1 and 5");
63+
};
64+
}
65+
66+
private int[] randomArray(int vIntByteSize, boolean isNeg) {
67+
final var out = new int[RANDOM_NUMS_PER_ITERATION];
68+
for (var i = 0; i < RANDOM_NUMS_PER_ITERATION; i++) {
69+
out[i] = randomVInt(vIntByteSize, isNeg);
70+
}
71+
return out;
72+
}
73+
74+
@Setup(Level.Iteration)
75+
public void resetNums() {
76+
vint1Byte = randomArray(1, false);
77+
vint2Bytes = randomArray(2, false);
78+
vint3Bytes = randomArray(3, false);
79+
vint4Bytes = randomArray(4, false);
80+
vint5Bytes = randomArray(5, false);
81+
vintNegBytes = randomArray(random.nextInt(1, 6), true);
82+
}
83+
84+
private void writeLoop(int[] nums) throws IOException {
85+
for (int reps = 0; reps < WRITES_PER_ITERATION / nums.length; reps++) {
86+
for (var n : nums) {
87+
output.writeVInt(n);
88+
}
89+
}
90+
output.seek(0);
91+
}
92+
93+
@Benchmark
94+
@OperationsPerInvocation(WRITES_PER_ITERATION)
95+
public void writeVInt1() throws IOException {
96+
writeLoop(vint1Byte);
97+
}
98+
99+
@Benchmark
100+
@OperationsPerInvocation(WRITES_PER_ITERATION)
101+
public void writeVInt2() throws IOException {
102+
writeLoop(vint2Bytes);
103+
}
104+
105+
@Benchmark
106+
@OperationsPerInvocation(WRITES_PER_ITERATION)
107+
public void writeVInt3() throws IOException {
108+
writeLoop(vint3Bytes);
109+
}
110+
111+
@Benchmark
112+
@OperationsPerInvocation(WRITES_PER_ITERATION)
113+
public void writeVInt4() throws IOException {
114+
writeLoop(vint4Bytes);
115+
}
116+
117+
@Benchmark
118+
@OperationsPerInvocation(WRITES_PER_ITERATION)
119+
public void writeVInt5() throws IOException {
120+
writeLoop(vint5Bytes);
121+
}
122+
123+
@Benchmark
124+
@OperationsPerInvocation(WRITES_PER_ITERATION)
125+
public void writeVIntNeg() throws IOException {
126+
writeLoop(vintNegBytes);
127+
}
128+
129+
// recycle same page, we never read previous pages
130+
private static class SinglePageStream implements Recycler<BytesRef> {
131+
132+
private final BytesRef page = new BytesRef(new byte[PAGE_SIZE], 0, PAGE_SIZE);
133+
134+
@Override
135+
public V<BytesRef> obtain() {
136+
return new V<>() {
137+
@Override
138+
public BytesRef v() {
139+
return page;
140+
}
141+
142+
@Override
143+
public boolean isRecycled() {
144+
return true;
145+
}
146+
147+
@Override
148+
public void close() {}
149+
};
150+
}
151+
152+
@Override
153+
public int pageSize() {
154+
return PAGE_SIZE;
155+
}
156+
}
157+
}

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/AggregatorBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,6 @@ private static void run(String grouping, String op, String blockType, String fil
733733
}
734734

735735
static DriverContext driverContext() {
736-
return new DriverContext(BigArrays.NON_RECYCLING_INSTANCE, blockFactory);
736+
return new DriverContext(BigArrays.NON_RECYCLING_INSTANCE, blockFactory, null);
737737
}
738738
}

0 commit comments

Comments
 (0)