Skip to content

Commit d915ed2

Browse files
committed
Merge branch 'main' of github.com:elastic/elasticsearch into bugfix/fix-priveledges-in-system-migration-block-main
2 parents 52def78 + 3444f91 commit d915ed2

File tree

82 files changed

+2268
-583
lines changed

Some content is hidden

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

82 files changed

+2268
-583
lines changed

docs/changelog/117176.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 117176
2+
summary: Integrate IBM watsonx to Inference API for re-ranking task
3+
area: Experiences
4+
type: enhancement
5+
issues: []

docs/changelog/121109.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 121109
2+
summary: Fix propagation of dynamic mapping parameter when applying `copy_to`
3+
area: Mapping
4+
type: bug
5+
issues:
6+
- 113049

docs/changelog/121260.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121260
2+
summary: Introduce a pre-mapping logical plan processing step
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/121325.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121325
2+
summary: '`ReindexDataStreamIndex` bug in assertion caused by reference equality'
3+
area: Data streams
4+
type: bug
5+
issues: []

docs/src/yamlRestTest/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ protected boolean isWatcherTest() {
286286

287287
/**
288288
* Compares the results of running two analyzers against many random
289-
* strings. The goal is to figure out if two anlayzers are "the same" by
289+
* strings. The goal is to figure out if two analyzers are "the same" by
290290
* comparing their results. This is far from perfect but should be fairly
291291
* accurate, especially for gross things like missing {@code decimal_digit}
292292
* token filters, and should be fairly fast because it compares a fairly

libs/entitlement/src/main/java/org/elasticsearch/entitlement/bootstrap/EntitlementBootstrap.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,22 @@
3131

3232
public class EntitlementBootstrap {
3333

34-
public record BootstrapArgs(Map<String, Policy> pluginPolicies, Function<Class<?>, String> pluginResolver) {
34+
public record BootstrapArgs(
35+
Map<String, Policy> pluginPolicies,
36+
Function<Class<?>, String> pluginResolver,
37+
Path[] dataDirs,
38+
Path configDir,
39+
Path tempDir
40+
) {
3541
public BootstrapArgs {
3642
requireNonNull(pluginPolicies);
3743
requireNonNull(pluginResolver);
44+
requireNonNull(dataDirs);
45+
if (dataDirs.length == 0) {
46+
throw new IllegalArgumentException("must provide at least one data directory");
47+
}
48+
requireNonNull(configDir);
49+
requireNonNull(tempDir);
3850
}
3951
}
4052

@@ -50,13 +62,22 @@ public static BootstrapArgs bootstrapArgs() {
5062
*
5163
* @param pluginPolicies a map holding policies for plugins (and modules), by plugin (or module) name.
5264
* @param pluginResolver a functor to map a Java Class to the plugin it belongs to (the plugin name).
65+
* @param dataDirs data directories for Elasticsearch
66+
* @param configDir the config directory for Elasticsearch
67+
* @param tempDir the temp directory for Elasticsearch
5368
*/
54-
public static void bootstrap(Map<String, Policy> pluginPolicies, Function<Class<?>, String> pluginResolver) {
69+
public static void bootstrap(
70+
Map<String, Policy> pluginPolicies,
71+
Function<Class<?>, String> pluginResolver,
72+
Path[] dataDirs,
73+
Path configDir,
74+
Path tempDir
75+
) {
5576
logger.debug("Loading entitlement agent");
5677
if (EntitlementBootstrap.bootstrapArgs != null) {
5778
throw new IllegalStateException("plugin data is already set");
5879
}
59-
EntitlementBootstrap.bootstrapArgs = new BootstrapArgs(pluginPolicies, pluginResolver);
80+
EntitlementBootstrap.bootstrapArgs = new BootstrapArgs(pluginPolicies, pluginResolver, dataDirs, configDir, tempDir);
6081
exportInitializationToAgent();
6182
loadAgent(findAgentJar());
6283
selfTest();

muted-tests.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,6 @@ tests:
231231
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
232232
method: test {p0=data_stream/140_data_stream_aliases/Create data stream aliases using wildcard expression}
233233
issue: https://github.com/elastic/elasticsearch/issues/120890
234-
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
235-
method: test {p0=ml/inference_crud/*}
236-
issue: https://github.com/elastic/elasticsearch/issues/120816
237234
- class: org.elasticsearch.xpack.security.authc.service.ServiceAccountIT
238235
method: testAuthenticateShouldNotFallThroughInCaseOfFailure
239236
issue: https://github.com/elastic/elasticsearch/issues/120902
@@ -330,6 +327,10 @@ tests:
330327
method: testCrossClusterAsyncQueryStop
331328
issue: https://github.com/elastic/elasticsearch/issues/121249
332329
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
330+
method: test {p0=transform/*}
331+
issue: https://github.com/elastic/elasticsearch/issues/120816
332+
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
333+
method: test {p0=ml/*}
333334
issue: https://github.com/elastic/elasticsearch/issues/120816
334335
- class: org.elasticsearch.upgrades.VectorSearchIT
335336
method: testBBQVectorSearch {upgradedNodes=0}
@@ -359,17 +360,38 @@ tests:
359360
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
360361
method: test {yaml=indices.get_alias/10_basic/Get aliases via /*/_alias/}
361362
issue: https://github.com/elastic/elasticsearch/issues/121290
362-
- class: org.elasticsearch.xpack.inference.action.TransportInferenceActionTests
363-
method: testRerouting_HandlesTransportException_FromOtherNode
364-
issue: https://github.com/elastic/elasticsearch/issues/121292
365-
- class: org.elasticsearch.xpack.inference.action.TransportInferenceActionTests
366-
method: testRerouting_ToOtherNode
367-
issue: https://github.com/elastic/elasticsearch/issues/121293
368-
- class: org.elasticsearch.xpack.inference.common.InferenceServiceNodeLocalRateLimitCalculatorTests
369-
issue: https://github.com/elastic/elasticsearch/issues/121294
370363
- class: org.elasticsearch.env.NodeEnvironmentTests
371364
method: testGetBestDowngradeVersion
372365
issue: https://github.com/elastic/elasticsearch/issues/121316
366+
- class: org.elasticsearch.index.engine.ShuffleForcedMergePolicyTests
367+
method: testDiagnostics
368+
issue: https://github.com/elastic/elasticsearch/issues/121336
369+
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
370+
method: test {yaml=reference/rest-api/security/invalidate-tokens/line_194}
371+
issue: https://github.com/elastic/elasticsearch/issues/121337
372+
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
373+
method: test {yaml=reference/rest-api/common-options/line_125}
374+
issue: https://github.com/elastic/elasticsearch/issues/121338
375+
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
376+
method: test {yaml=reference/snapshot-restore/apis/get-snapshot-api/line_751}
377+
issue: https://github.com/elastic/elasticsearch/issues/121345
378+
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
379+
method: testHasPrivileges
380+
issue: https://github.com/elastic/elasticsearch/issues/121346
381+
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
382+
method: testActivateProfile
383+
issue: https://github.com/elastic/elasticsearch/issues/121151
384+
- class: org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT
385+
method: test {yaml=search.vectors/42_knn_search_int4_flat/Vector similarity with filter only}
386+
issue: https://github.com/elastic/elasticsearch/issues/121350
387+
- class: org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT
388+
method: test {p0=search.vectors/42_knn_search_int4_flat/KNN Vector similarity search only}
389+
issue: https://github.com/elastic/elasticsearch/issues/121395
390+
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
391+
issue: https://github.com/elastic/elasticsearch/issues/121407
392+
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
393+
method: testDependentVariableIsAliasToNested
394+
issue: https://github.com/elastic/elasticsearch/issues/121415
373395

374396
# Examples:
375397
#

rest-api-spec/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,5 @@ tasks.named("yamlRestCompatTestTransform").configure ({ task ->
7373
task.skipTest("index/92_metrics_auto_subobjects/Root without subobjects with synthetic source", "_source.mode mapping attribute is no-op since 9.0.0")
7474
task.skipTest("index/91_metrics_no_subobjects/Metrics object indexing with synthetic source", "_source.mode mapping attribute is no-op since 9.0.0")
7575
task.skipTest("index/91_metrics_no_subobjects/Root without subobjects with synthetic source", "_source.mode mapping attribute is no-op since 9.0.0")
76+
task.skipTest("indices.create/20_synthetic_source/synthetic_source with copy_to inside nested object", "temporary until backported")
7677
})
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
copy_to from object with dynamic strict to dynamic field:
3+
- requires:
4+
cluster_features: ["mapper.copy_to.dynamic_handling"]
5+
reason: requires a fix
6+
7+
- do:
8+
indices.create:
9+
index: test
10+
body:
11+
mappings:
12+
properties:
13+
one:
14+
dynamic: strict
15+
properties:
16+
k:
17+
type: keyword
18+
copy_to: two.k
19+
20+
- do:
21+
index:
22+
index: test
23+
id: 1
24+
refresh: true
25+
body:
26+
one:
27+
k: "hey"
28+
29+
- do:
30+
search:
31+
index: test
32+
body:
33+
docvalue_fields: [ "two.k.keyword" ]
34+
35+
- match:
36+
hits.hits.0._source:
37+
one:
38+
k: "hey"
39+
- match:
40+
hits.hits.0.fields:
41+
two.k.keyword: [ "hey" ]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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.action.admin.indices.mapping.put;
11+
12+
import org.apache.logging.log4j.Level;
13+
import org.elasticsearch.action.support.master.AcknowledgedResponse;
14+
import org.elasticsearch.test.ESSingleNodeTestCase;
15+
import org.elasticsearch.test.MockLog;
16+
import org.elasticsearch.test.junit.annotations.TestLogging;
17+
18+
import static org.hamcrest.Matchers.equalTo;
19+
20+
public class PutMappingIT extends ESSingleNodeTestCase {
21+
22+
@TestLogging(
23+
reason = "testing DEBUG logging",
24+
value = "org.elasticsearch.action.admin.indices.mapping.put.TransportPutMappingAction:DEBUG"
25+
)
26+
public void testFailureLogging() {
27+
final var indexName = randomIdentifier();
28+
createIndex(indexName);
29+
final var fieldName = randomIdentifier();
30+
safeGet(client().execute(TransportPutMappingAction.TYPE, new PutMappingRequest(indexName).source(fieldName, "type=keyword")));
31+
MockLog.assertThatLogger(
32+
() -> assertThat(
33+
asInstanceOf(
34+
IllegalArgumentException.class,
35+
safeAwaitFailure(
36+
AcknowledgedResponse.class,
37+
l -> client().execute(
38+
TransportPutMappingAction.TYPE,
39+
new PutMappingRequest(indexName).source(fieldName, "type=long"),
40+
l
41+
)
42+
)
43+
).getMessage(),
44+
equalTo("mapper [" + fieldName + "] cannot be changed from type [keyword] to [long]")
45+
),
46+
TransportPutMappingAction.class,
47+
new MockLog.SeenEventExpectation(
48+
"failure message",
49+
TransportPutMappingAction.class.getCanonicalName(),
50+
Level.DEBUG,
51+
"failed to put mappings on indices [[" + indexName
52+
)
53+
);
54+
}
55+
}

0 commit comments

Comments
 (0)