Skip to content

Commit 1c3f823

Browse files
committed
Merge branch 'main' into 2025/04/11/fix-126628
2 parents c4239ac + 4cc21b6 commit 1c3f823

File tree

86 files changed

+3917
-3159
lines changed

Some content is hidden

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

86 files changed

+3917
-3159
lines changed

.buildkite/scripts/dra-workflow.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ echo --- Building release artifacts
7070
$VERSION_QUALIFIER_ARG \
7171
buildReleaseArtifacts \
7272
exportCompressedDockerImages \
73+
exportDockerContexts \
7374
:distribution:generateDependenciesReport
7475

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

benchmarks/src/main/java/org/elasticsearch/benchmark/routing/allocation/AllocationBenchmark.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
import org.elasticsearch.cluster.ClusterState;
1515
import org.elasticsearch.cluster.metadata.IndexMetadata;
1616
import org.elasticsearch.cluster.metadata.Metadata;
17+
import org.elasticsearch.cluster.metadata.ProjectId;
18+
import org.elasticsearch.cluster.metadata.ProjectMetadata;
1719
import org.elasticsearch.cluster.node.DiscoveryNodes;
20+
import org.elasticsearch.cluster.routing.GlobalRoutingTable;
1821
import org.elasticsearch.cluster.routing.RoutingTable;
1922
import org.elasticsearch.cluster.routing.ShardRouting;
2023
import org.elasticsearch.cluster.routing.allocation.AllocationService;
@@ -126,19 +129,20 @@ public void setUp() throws Exception {
126129
Settings.builder().put("cluster.routing.allocation.awareness.attributes", "tag").build()
127130
);
128131

129-
Metadata.Builder mb = Metadata.builder();
132+
final ProjectId projectId = ProjectId.DEFAULT;
133+
ProjectMetadata.Builder pmb = ProjectMetadata.builder(projectId);
130134
for (int i = 1; i <= numIndices; i++) {
131-
mb.put(
135+
pmb.put(
132136
IndexMetadata.builder("test_" + i)
133137
.settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current()))
134138
.numberOfShards(numShards)
135139
.numberOfReplicas(numReplicas)
136140
);
137141
}
138-
Metadata metadata = mb.build();
142+
Metadata metadata = Metadata.builder().put(pmb).build();
139143
RoutingTable.Builder rb = RoutingTable.builder(TestShardRoutingRoleStrategies.DEFAULT_ROLE_ONLY);
140144
for (int i = 1; i <= numIndices; i++) {
141-
rb.addAsNew(metadata.getProject().index("test_" + i));
145+
rb.addAsNew(metadata.getProject(projectId).index("test_" + i));
142146
}
143147
RoutingTable routingTable = rb.build();
144148
DiscoveryNodes.Builder nb = DiscoveryNodes.builder();
@@ -151,7 +155,7 @@ public void setUp() throws Exception {
151155
}
152156
initialClusterState = ClusterState.builder(ClusterName.DEFAULT)
153157
.metadata(metadata)
154-
.routingTable(routingTable)
158+
.routingTable(GlobalRoutingTable.builder().put(projectId, routingTable).build())
155159
.nodes(nb)
156160
.nodeIdsToCompatibilityVersions(compatibilityVersions)
157161
.build();

distribution/docker/build.gradle

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ dependencies {
132132
fips "org.bouncycastle:bctls-fips:1.0.19"
133133
}
134134

135-
ext.expansions = { Architecture architecture, DockerBase base ->
135+
ext.expansions = { Architecture architecture, DockerBase base, String publicationContext = '' ->
136136
def (major, minor) = VersionProperties.elasticsearch.split("\\.")
137137

138138
// We tag our Docker images with various pieces of information, including a timestamp
@@ -152,6 +152,7 @@ ext.expansions = { Architecture architecture, DockerBase base ->
152152
'license' : base == DockerBase.IRON_BANK ? 'Elastic License 2.0' : 'Elastic-License-2.0',
153153
'package_manager' : base.packageManager,
154154
'docker_base' : base.name().toLowerCase(),
155+
'docker_context' : publicationContext,
155156
'version' : VersionProperties.elasticsearch,
156157
'major_minor_version': "${major}.${minor}",
157158
'retry' : ShellRetry
@@ -179,9 +180,9 @@ private static String taskName(String prefix, Architecture architecture, DockerB
179180
suffix
180181
}
181182

182-
ext.dockerBuildContext = { Architecture architecture, DockerBase base ->
183+
ext.dockerBuildContext = { Architecture architecture, DockerBase base, String publicationContext = '' ->
183184
copySpec {
184-
final Map<String, String> varExpansions = expansions(architecture, base)
185+
final Map<String, String> varExpansions = expansions(architecture, base, publicationContext)
185186
final Path projectDir = project.projectDir.toPath()
186187

187188
if (base == DockerBase.IRON_BANK) {
@@ -291,17 +292,22 @@ tasks.named("composeUp").configure {
291292
dependsOn tasks.named("preProcessFixture")
292293
}
293294

294-
void addBuildDockerContextTask(Architecture architecture, DockerBase base) {
295+
296+
def exportDockerImages = tasks.register("exportDockerImages")
297+
def exportCompressedDockerImages = tasks.register("exportCompressedDockerImages")
298+
def exportDockerContexts = tasks.register("exportDockerContexts")
299+
300+
void addBuildDockerContextTask(Architecture architecture, DockerBase base, String taskSuffix = 'DockerContext', String classifier = "docker-build-context") {
295301
String configDirectory = base == DockerBase.IRON_BANK ? 'scripts' : 'config'
296302
String arch = architecture == Architecture.AARCH64 ? '-aarch64' : ''
297303

298304
final TaskProvider<Tar> buildDockerContextTask =
299-
tasks.register(taskName('build', architecture, base, 'DockerContext'), Tar) {
305+
tasks.register(taskName('build', architecture, base, taskSuffix), Tar) {
300306
archiveExtension = 'tar.gz'
301307
compression = Compression.GZIP
302-
archiveClassifier = "docker-build-context${arch}"
308+
archiveClassifier = "${classifier}${arch}"
303309
archiveBaseName = "elasticsearch${base.suffix}"
304-
with dockerBuildContext(architecture, base)
310+
with dockerBuildContext(architecture, base, classifier)
305311

306312
into(configDirectory) {
307313
from(configurations.log4jConfig) {
@@ -344,6 +350,10 @@ void addBuildDockerContextTask(Architecture architecture, DockerBase base) {
344350
onlyIf("$architecture supported") { serviceProvider.get().isArchitectureSupported(architecture) }
345351
}
346352

353+
exportDockerContexts.configure {
354+
dependsOn buildDockerContextTask
355+
}
356+
347357
if (base == DockerBase.IRON_BANK) {
348358
tasks.named("assemble").configure {
349359
dependsOn(buildDockerContextTask)
@@ -578,12 +588,14 @@ for (final Architecture architecture : Architecture.values()) {
578588
addTransformDockerContextTask(architecture, base)
579589
addBuildDockerImageTask(architecture, base)
580590
}
591+
if(base == DockerBase.DEFAULT) {
592+
// Add additional docker hub specific context which we use solely for publishing to docker hub.
593+
// At the moment it only differs in not labels added that we need for openshift certification
594+
addBuildDockerContextTask(architecture, base, 'DockerHubContext', "docker-hub-build-context")
595+
}
581596
}
582597
}
583598

584-
def exportDockerImages = tasks.register("exportDockerImages")
585-
def exportCompressedDockerImages = tasks.register("exportCompressedDockerImages")
586-
587599
/*
588600
* The export subprojects write out the generated Docker images to disk, so
589601
* that they can be easily reloaded, for example into a VM for distribution testing

distribution/docker/src/docker/Dockerfile.default

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,15 @@ LABEL org.label-schema.build-date="${build_date}" \\
139139
org.opencontainers.image.vendor="Elastic" \\
140140
org.opencontainers.image.version="${version}"
141141

142+
<% if (docker_context != 'docker-hub-build-context') { %>
142143
LABEL name="Elasticsearch" \\
143144
maintainer="[email protected]" \\
144145
vendor="Elastic" \\
145146
version="${version}" \\
146147
release="1" \\
147148
summary="Elasticsearch" \\
148149
description="You know, for search."
150+
<% } %>
149151

150152
RUN mkdir /licenses && ln LICENSE.txt /licenses/LICENSE
151153

docs/changelog/125832.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 125832
2+
summary: "ESQL: Fix `NULL` handling in `IN` clause"
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 119950

docs/changelog/126273.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126273
2+
summary: Fix LTR rescorer with model alias
3+
area: Ranking
4+
type: bug
5+
issues: []

docs/changelog/126319.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126319
2+
summary: COMPLETION command grammar and logical plan
3+
area: ES|QL
4+
type: feature
5+
issues: []

docs/changelog/126637.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126637
2+
summary: Improve resiliency of `UpdateTimeSeriesRangeService`
3+
area: TSDB
4+
type: bug
5+
issues: []

docs/internal/DistributedArchitectureGuide.md

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,50 +22,6 @@ See the [Javadocs for `ActionListener`](https://github.com/elastic/elasticsearch
2222

2323
(TODO: add useful starter references and explanations for a range of Listener classes. Reference the Netty section.)
2424

25-
### REST Layer
26-
27-
The REST and Transport layers are bound together through the `ActionModule`. `ActionModule#initRestHandlers` registers all the
28-
rest actions with a `RestController` that matches incoming requests to particular REST actions. `RestController#registerHandler`
29-
uses each `Rest*Action`'s `#routes()` implementation to match HTTP requests to that particular `Rest*Action`. Typically, REST
30-
actions follow the class naming convention `Rest*Action`, which makes them easier to find, but not always; the `#routes()`
31-
definition can also be helpful in finding a REST action. `RestController#dispatchRequest` eventually calls `#handleRequest` on a
32-
`RestHandler` implementation. `RestHandler` is the base class for `BaseRestHandler`, which most `Rest*Action` instances extend to
33-
implement a particular REST action.
34-
35-
`BaseRestHandler#handleRequest` calls into `BaseRestHandler#prepareRequest`, which children `Rest*Action` classes extend to
36-
define the behavior for a particular action. `RestController#dispatchRequest` passes a `RestChannel` to the `Rest*Action` via
37-
`RestHandler#handleRequest`: `Rest*Action#prepareRequest` implementations return a `RestChannelConsumer` defining how to execute
38-
the action and reply on the channel (usually in the form of completing an ActionListener wrapper). `Rest*Action#prepareRequest`
39-
implementations are responsible for parsing the incoming request, and verifying that the structure of the request is valid.
40-
`BaseRestHandler#handleRequest` will then check that all the request parameters have been consumed: unexpected request parameters
41-
result in an error.
42-
43-
### How REST Actions Connect to Transport Actions
44-
45-
The Rest layer uses an implementation of `AbstractClient`. `BaseRestHandler#prepareRequest` takes a `NodeClient`: this client
46-
knows how to connect to a specified TransportAction. A `Rest*Action` implementation will return a `RestChannelConsumer` that
47-
most often invokes a call into a method on the `NodeClient` to pass through to the TransportAction. Along the way from
48-
`BaseRestHandler#prepareRequest` through the `AbstractClient` and `NodeClient` code, `NodeClient#executeLocally` is called: this
49-
method calls into `TaskManager#registerAndExecute`, registering the operation with the `TaskManager` so it can be found in Task
50-
API requests, before moving on to execute the specified TransportAction.
51-
52-
`NodeClient` has a `NodeClient#actions` map from `ActionType` to `TransportAction`. `ActionModule#setupActions` registers all the
53-
core TransportActions, as well as those defined in any plugins that are being used: plugins can override `Plugin#getActions()` to
54-
define additional TransportActions. Note that not all TransportActions will be mapped back to a REST action: many TransportActions
55-
are only used for internode operations/communications.
56-
57-
### Transport Layer
58-
59-
(Managed by the TransportService, TransportActions must be registered there, too)
60-
61-
(Executing a TransportAction (either locally via NodeClient or remotely via TransportService) is where most of the authorization & other security logic runs)
62-
63-
(What actions, and why, are registered in TransportService but not NodeClient?)
64-
65-
### Direct Node to Node Transport Layer
66-
67-
(TransportService maps incoming requests to TransportActions)
68-
6925
### Chunk Encoding
7026

7127
#### XContent

docs/internal/GeneralArchitectureGuide.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
11
# General Architecture
22

3-
## Transport Actions
3+
# REST and Transport Layers
4+
5+
### REST Layer
6+
7+
The REST and Transport layers are bound together through the `ActionModule`. `ActionModule#initRestHandlers` registers all the
8+
rest actions with a `RestController` that matches incoming requests to particular REST actions. `RestController#registerHandler`
9+
uses each `Rest*Action`'s `#routes()` implementation to match HTTP requests to that particular `Rest*Action`. Typically, REST
10+
actions follow the class naming convention `Rest*Action`, which makes them easier to find, but not always; the `#routes()`
11+
definition can also be helpful in finding a REST action. `RestController#dispatchRequest` eventually calls `#handleRequest` on a
12+
`RestHandler` implementation. `RestHandler` is the base class for `BaseRestHandler`, which most `Rest*Action` instances extend to
13+
implement a particular REST action.
14+
15+
`BaseRestHandler#handleRequest` calls into `BaseRestHandler#prepareRequest`, which children `Rest*Action` classes extend to
16+
define the behavior for a particular action. `RestController#dispatchRequest` passes a `RestChannel` to the `Rest*Action` via
17+
`RestHandler#handleRequest`: `Rest*Action#prepareRequest` implementations return a `RestChannelConsumer` defining how to execute
18+
the action and reply on the channel (usually in the form of completing an ActionListener wrapper). `Rest*Action#prepareRequest`
19+
implementations are responsible for parsing the incoming request, and verifying that the structure of the request is valid.
20+
`BaseRestHandler#handleRequest` will then check that all the request parameters have been consumed: unexpected request parameters
21+
result in an error.
22+
23+
### How REST Actions Connect to Transport Actions
24+
25+
The Rest layer uses an implementation of `AbstractClient`. `BaseRestHandler#prepareRequest` takes a `NodeClient`: this client
26+
knows how to connect to a specified TransportAction. A `Rest*Action` implementation will return a `RestChannelConsumer` that
27+
most often invokes a call into a method on the `NodeClient` to pass through to the TransportAction. Along the way from
28+
`BaseRestHandler#prepareRequest` through the `AbstractClient` and `NodeClient` code, `NodeClient#executeLocally` is called: this
29+
method calls into `TaskManager#registerAndExecute`, registering the operation with the `TaskManager` so it can be found in Task
30+
API requests, before moving on to execute the specified TransportAction.
31+
32+
`NodeClient` has a `NodeClient#actions` map from `ActionType` to `TransportAction`. `ActionModule#setupActions` registers all the
33+
core TransportActions, as well as those defined in any plugins that are being used: plugins can override `Plugin#getActions()` to
34+
define additional TransportActions. Note that not all TransportActions will be mapped back to a REST action: many TransportActions
35+
are only used for internode operations/communications.
36+
37+
### Transport Layer
38+
39+
(Managed by the TransportService, TransportActions must be registered there, too)
40+
41+
(Executing a TransportAction (either locally via NodeClient or remotely via TransportService) is where most of the authorization & other security logic runs)
42+
43+
(What actions, and why, are registered in TransportService but not NodeClient?)
44+
45+
### Direct Node to Node Transport Layer
46+
47+
(TransportService maps incoming requests to TransportActions)
448

549
## Serializations
650

0 commit comments

Comments
 (0)