Skip to content

Commit 068bee9

Browse files
Merge branch 'main' into fix/snapshotstats-fromxcontent
2 parents 165314c + f9fe613 commit 068bee9

File tree

93 files changed

+4986
-1358
lines changed

Some content is hidden

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

93 files changed

+4986
-1358
lines changed

distribution/docker/src/docker/dockerfiles/default/Dockerfile

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,20 @@ RUN microdnf install -y findutils tar gzip
2929
# The tini GitHub page gives instructions for verifying the binary using
3030
# gpg, but the keyservers are slow to return the key and this can fail the
3131
# build. Instead, we check the binary against the published checksum.
32-
RUN set -eux ; \\
33-
tini_bin="" ; \\
34-
arch="\$(rpm --query --queryformat='%{ARCH}' rpm)"; \
35-
case "\$(arch)" in \\
36-
aarch64) tini_bin='tini-arm64' ;; \\
37-
x86_64) tini_bin='tini-amd64' ;; \\
38-
*) echo >&2 ; echo >&2 "Unsupported architecture \$arch" ; echo >&2 ; exit 1 ;; \\
32+
RUN set -eux; \\
33+
arch="\$(rpm --query --queryformat='%{ARCH}' rpm)"; \\
34+
case "\$arch" in \\
35+
aarch64) tini_bin='tini-arm64'; tini_sum='07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81' ;; \\
36+
x86_64) tini_bin='tini-amd64'; tini_sum='93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c' ;; \\
37+
*) echo >&2 "Unsupported architecture \$arch"; exit 1 ;; \\
3938
esac ; \\
40-
curl -f --retry 10 -S -L -O https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin} ; \\
41-
curl -f --retry 10 -S -L -O https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin}.sha256sum ; \\
42-
sha256sum -c \${tini_bin}.sha256sum ; \\
43-
rm \${tini_bin}.sha256sum ; \\
44-
mv \${tini_bin} /bin/tini ; \\
39+
curl -f --retry 10 -S -L -o /tmp/tini https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin}; \\
40+
echo "\${tini_sum} /tmp/tini" | sha256sum -c -; \\
41+
mv /tmp/tini /bin/tini; \\
4542
chmod 0555 /bin/tini
4643
4744
WORKDIR /usr/share/elasticsearch
48-
RUN arch="\$(rpm --query --queryformat='%{ARCH}' rpm)" && curl -f --retry 10 -S -L --output /tmp/elasticsearch.tar.gz https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/elasticsearch-${version}-linux-\$(arch).tar.gz
45+
RUN arch="\$(rpm --query --queryformat='%{ARCH}' rpm)" && curl -f --retry 10 -S -L --output /tmp/elasticsearch.tar.gz https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/elasticsearch-${version}-linux-\$arch.tar.gz
4946
RUN tar -zxf /tmp/elasticsearch.tar.gz --strip-components=1 && \\
5047
# Configure the distribution for Docker
5148
sed -i -e 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' bin/elasticsearch-env && \\
@@ -111,12 +108,10 @@ ENV SHELL=/bin/bash
111108
COPY --chmod=0555 bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
112109

113110
RUN chmod g=u /etc/passwd && \\
114-
chmod 0555 /usr/local/bin/docker-entrypoint.sh && \\
115111
find / -xdev -perm -4000 -exec chmod ug-s {} + && \\
116112
chmod 0775 /usr/share/elasticsearch && \\
117113
chown elasticsearch bin config config/jvm.options.d data logs plugins
118114

119-
120115
EXPOSE 9200 9300
121116

122117
LABEL org.label-schema.build-date="${build_date}" \\

docs/changelog/127797.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 127797
2+
summary: "Date nanos implicit casting in union types option #2"
3+
area: ES|QL
4+
type: enhancement
5+
issues:
6+
- 110009

docs/changelog/128788.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 105773
2+
summary: Inject an unfollow action before executing a downsample action in ILM
3+
area: ILM+SLM
4+
type: bug
5+
issues:
6+
- 105773

docs/changelog/128858.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 128858
2+
summary: Fix unsupported privileges error message during role and API key crea…
3+
area: Authorization
4+
type: enhancement
5+
issues:
6+
- 128132

muted-tests.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,6 @@ tests:
300300
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
301301
method: testSearchWithRandomDisconnects
302302
issue: https://github.com/elastic/elasticsearch/issues/122707
303-
- class: org.elasticsearch.xpack.esql.inference.RerankOperatorTests
304-
method: testSimpleCircuitBreaking
305-
issue: https://github.com/elastic/elasticsearch/issues/124337
306303
- class: org.elasticsearch.index.engine.ThreadPoolMergeSchedulerTests
307304
method: testSchedulerCloseWaitsForRunningMerge
308305
issue: https://github.com/elastic/elasticsearch/issues/125236
@@ -384,9 +381,6 @@ tests:
384381
- class: org.elasticsearch.packaging.test.DockerTests
385382
method: test024InstallPluginFromArchiveUsingConfigFile
386383
issue: https://github.com/elastic/elasticsearch/issues/126936
387-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
388-
method: test {rerank.Reranker before a limit ASYNC}
389-
issue: https://github.com/elastic/elasticsearch/issues/127051
390384
- class: org.elasticsearch.packaging.test.DockerTests
391385
method: test026InstallBundledRepositoryPlugins
392386
issue: https://github.com/elastic/elasticsearch/issues/127081
@@ -399,9 +393,6 @@ tests:
399393
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
400394
method: test {p0=ml/data_frame_analytics_cat_apis/Test cat data frame analytics all jobs with header}
401395
issue: https://github.com/elastic/elasticsearch/issues/127625
402-
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
403-
method: test {rerank.Reranker using another sort order ASYNC}
404-
issue: https://github.com/elastic/elasticsearch/issues/127638
405396
- class: org.elasticsearch.xpack.search.CrossClusterAsyncSearchIT
406397
method: testCancellationViaTimeoutWithAllowPartialResultsSetToFalse
407398
issue: https://github.com/elastic/elasticsearch/issues/127096
@@ -474,9 +465,6 @@ tests:
474465
- class: org.elasticsearch.xpack.esql.plugin.DataNodeRequestSenderIT
475466
method: testSearchWhileRelocating
476467
issue: https://github.com/elastic/elasticsearch/issues/128500
477-
- class: org.elasticsearch.xpack.ccr.index.engine.FollowingEngineTests
478-
method: testProcessOnceOnPrimary
479-
issue: https://github.com/elastic/elasticsearch/issues/128541
480468
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
481469
method: testFailToStartRequestOnRemoteCluster
482470
issue: https://github.com/elastic/elasticsearch/issues/128545
@@ -504,6 +492,12 @@ tests:
504492
- class: org.elasticsearch.packaging.test.DockerTests
505493
method: test150MachineDependentHeap
506494
issue: https://github.com/elastic/elasticsearch/issues/128120
495+
- class: org.elasticsearch.xpack.inference.InferenceGetServicesIT
496+
method: testGetServicesWithCompletionTaskType
497+
issue: https://github.com/elastic/elasticsearch/issues/128952
498+
- class: org.elasticsearch.xpack.ccr.index.engine.FollowingEngineTests
499+
method: testProcessOnceOnPrimary
500+
issue: https://github.com/elastic/elasticsearch/issues/128541
507501

508502
# Examples:
509503
#

server/src/main/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ protected void masterOperation(
276276

277277
AutoShardingResult rolloverAutoSharding = null;
278278
final IndexAbstraction indexAbstraction = projectMetadata.getIndicesLookup().get(resolvedRolloverTarget.resource());
279-
if (indexAbstraction.getType().equals(IndexAbstraction.Type.DATA_STREAM)) {
279+
// Failure stores currently don't support auto sharding yet.
280+
if (indexAbstraction.getType().equals(IndexAbstraction.Type.DATA_STREAM) && targetFailureStore == false) {
280281
DataStream dataStream = (DataStream) indexAbstraction;
281282
IndexStats indexStats = statsResponse != null ? statsResponse.getIndex(dataStream.getWriteIndex().getName()) : null;
282283
rolloverAutoSharding = dataStreamAutoShardingService.calculate(projectState, dataStream, indexStats);

server/src/main/java/org/elasticsearch/cluster/ProjectState.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.elasticsearch.cluster.metadata.ProjectId;
1414
import org.elasticsearch.cluster.metadata.ProjectMetadata;
1515
import org.elasticsearch.cluster.routing.RoutingTable;
16+
import org.elasticsearch.common.Strings;
1617

1718
import java.util.Objects;
1819
import java.util.function.Consumer;
@@ -74,4 +75,24 @@ public ClusterState updatedState(Consumer<ProjectMetadata.Builder> projectBuilde
7475
projectBuilderConsumer.accept(projectBuilder);
7576
return ClusterState.builder(cluster).putProjectMetadata(projectBuilder).build();
7677
}
78+
79+
/**
80+
* Build a new {@link ProjectState} with the updated {@code project}.
81+
*/
82+
public ProjectState updateProject(ProjectMetadata updatedProject) {
83+
// No need to build a new object if the project is unchanged.
84+
if (metadata() == updatedProject) {
85+
return this;
86+
}
87+
if (project.equals(updatedProject.id()) == false) {
88+
throw new IllegalArgumentException(
89+
Strings.format(
90+
"Unable to update project state with project ID [%s] because updated project has ID [%s]",
91+
project,
92+
updatedProject.id()
93+
)
94+
);
95+
}
96+
return new ProjectState(ClusterState.builder(cluster).putProjectMetadata(updatedProject).build(), project);
97+
}
7798
}

server/src/main/java/org/elasticsearch/cluster/metadata/ProjectId.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
9090
}
9191

9292
public static ProjectId fromXContent(XContentParser parser) throws IOException {
93-
return new ProjectId(parser.text());
93+
return fromId(parser.text());
9494
}
9595

9696
public static ProjectId ofNullable(@Nullable String id, @Nullable ProjectId fallback) {
97-
return id == null ? fallback : new ProjectId(id);
97+
return id == null ? fallback : fromId(id);
9898
}
9999

100100
@Override

test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@
5757
import org.elasticsearch.client.internal.ElasticsearchClient;
5858
import org.elasticsearch.client.internal.Requests;
5959
import org.elasticsearch.cluster.ClusterModule;
60+
import org.elasticsearch.cluster.ClusterName;
61+
import org.elasticsearch.cluster.ClusterState;
62+
import org.elasticsearch.cluster.ProjectState;
6063
import org.elasticsearch.cluster.metadata.IndexMetadata;
6164
import org.elasticsearch.cluster.metadata.Metadata;
6265
import org.elasticsearch.cluster.metadata.ProjectId;
66+
import org.elasticsearch.cluster.metadata.ProjectMetadata;
6367
import org.elasticsearch.common.CheckedSupplier;
6468
import org.elasticsearch.common.UUIDs;
6569
import org.elasticsearch.common.breaker.CircuitBreaker;
@@ -2818,4 +2822,11 @@ public static IndexSearcher newSearcher(IndexReader r, boolean maybeWrap, boolea
28182822
}
28192823
return newSearcher(r, maybeWrap, wrapWithAssertions, Concurrency.NONE);
28202824
}
2825+
2826+
/**
2827+
* Constructs a {@link ProjectState} for the given {@link ProjectMetadata.Builder}.
2828+
*/
2829+
public static ProjectState projectStateFromProject(ProjectMetadata.Builder project) {
2830+
return ClusterState.builder(ClusterName.DEFAULT).putProjectMetadata(project).build().projectState(project.getId());
2831+
}
28212832
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/BranchingStep.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.apache.logging.log4j.LogManager;
1111
import org.apache.logging.log4j.Logger;
1212
import org.apache.lucene.util.SetOnce;
13-
import org.elasticsearch.cluster.ClusterState;
13+
import org.elasticsearch.cluster.ProjectState;
1414
import org.elasticsearch.cluster.metadata.IndexMetadata;
1515
import org.elasticsearch.cluster.metadata.ProjectMetadata;
1616
import org.elasticsearch.index.Index;
@@ -62,15 +62,15 @@ public boolean isRetryable() {
6262
}
6363

6464
@Override
65-
public ClusterState performAction(Index index, ClusterState clusterState) {
66-
IndexMetadata indexMetadata = clusterState.metadata().getProject().index(index);
65+
public ProjectState performAction(Index index, ProjectState projectState) {
66+
IndexMetadata indexMetadata = projectState.metadata().index(index);
6767
if (indexMetadata == null) {
6868
// Index must have been since deleted, ignore it
6969
logger.debug("[{}] lifecycle action for index [{}] executed but index no longer exists", getKey().action(), index.getName());
70-
return clusterState;
70+
return projectState;
7171
}
72-
predicateValue.set(predicate.test(index, clusterState.metadata().getProject()));
73-
return clusterState;
72+
predicateValue.set(predicate.test(index, projectState.metadata()));
73+
return projectState;
7474
}
7575

7676
/**

0 commit comments

Comments
 (0)