Skip to content

Commit c8299cd

Browse files
authored
Merge branch 'main' into file-prefixes
2 parents 8600288 + ed12833 commit c8299cd

File tree

50 files changed

+1538
-1074
lines changed

Some content is hidden

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

50 files changed

+1538
-1074
lines changed

docs/changelog/121240.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121240
2+
summary: Implement runtime skip_unavailable=true
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/121256.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121256
2+
summary: Run `TransportEnrichStatsAction` on local node
3+
area: Ingest Node
4+
type: enhancement
5+
issues: []

docs/changelog/121556.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121556
2+
summary: Enable New Semantic Text Format Only On Newly Created Indices
3+
area: Mapping
4+
type: bug
5+
issues: []

muted-tests.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,9 @@ tests:
122122
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
123123
method: test {p0=search.highlight/50_synthetic_source/text multi unified from vectors}
124124
issue: https://github.com/elastic/elasticsearch/issues/117815
125-
- class: org.elasticsearch.xpack.esql.plugin.ClusterRequestTests
126-
method: testFallbackIndicesOptions
127-
issue: https://github.com/elastic/elasticsearch/issues/117937
128125
- class: org.elasticsearch.xpack.ml.integration.RegressionIT
129126
method: testTwoJobsWithSameRandomizeSeedUseSameTrainingSet
130127
issue: https://github.com/elastic/elasticsearch/issues/117805
131-
- class: org.elasticsearch.xpack.esql.action.EsqlActionTaskIT
132-
method: testCancelRequestWhenFailingFetchingPages
133-
issue: https://github.com/elastic/elasticsearch/issues/118193
134128
- class: org.elasticsearch.packaging.test.ArchiveTests
135129
method: test44AutoConfigurationNotTriggeredOnNotWriteableConfDir
136130
issue: https://github.com/elastic/elasticsearch/issues/118208
@@ -384,9 +378,6 @@ tests:
384378
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
385379
method: testDependentVariableIsAliasToNested
386380
issue: https://github.com/elastic/elasticsearch/issues/121415
387-
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
388-
method: testLookupExplosionBigStringManyMatches
389-
issue: https://github.com/elastic/elasticsearch/issues/121465
390381
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
391382
method: testClientSecretRotation
392383
issue: https://github.com/elastic/elasticsearch/issues/120985
@@ -396,9 +387,6 @@ tests:
396387
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
397388
method: test {yaml=cluster.health/10_basic/cluster health basic test}
398389
issue: https://github.com/elastic/elasticsearch/issues/121478
399-
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
400-
method: testLookupExplosionManyMatches
401-
issue: https://github.com/elastic/elasticsearch/issues/121481
402390
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
403391
method: testGetUsersWithProfileUid
404392
issue: https://github.com/elastic/elasticsearch/issues/121483
@@ -408,15 +396,6 @@ tests:
408396
- class: org.elasticsearch.xpack.transform.checkpoint.TransformCCSCanMatchIT
409397
method: testTransformLifecycle_RangeQueryThatMatchesNoShards
410398
issue: https://github.com/elastic/elasticsearch/issues/121480
411-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
412-
method: testStopQueryLocal
413-
issue: https://github.com/elastic/elasticsearch/issues/121487
414-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
415-
method: testSuccessfulPathways
416-
issue: https://github.com/elastic/elasticsearch/issues/121488
417-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
418-
method: testAsyncQueriesWithLimit0
419-
issue: https://github.com/elastic/elasticsearch/issues/121489
420399
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
421400
method: testSuggestProfilesWithHint
422401
issue: https://github.com/elastic/elasticsearch/issues/121116
@@ -449,6 +428,9 @@ tests:
449428
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
450429
method: test {yaml=snapshot.create/10_basic/Create a snapshot for missing index}
451430
issue: https://github.com/elastic/elasticsearch/issues/121536
431+
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryUnavailableRemotesIT
432+
method: testRemoteOnlyCCSAgainstDisconnectedRemoteWithSkipUnavailableTrue
433+
issue: https://github.com/elastic/elasticsearch/issues/121578
452434

453435
# Examples:
454436
#

rest-api-spec/src/main/resources/rest-api-spec/api/enrich.stats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"params": {
2121
"master_timeout":{
2222
"type":"time",
23-
"description":"Timeout for processing on master node"
23+
"description":"Timeout for waiting for new cluster state in case it is blocked"
2424
}
2525
}
2626
}

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ static TransportVersion def(int id) {
172172
public static final TransportVersion TIMEOUT_GET_PARAM_FOR_RESOLVE_CLUSTER = def(8_838_0_00);
173173
public static final TransportVersion INFERENCE_REQUEST_ADAPTIVE_RATE_LIMITING = def(8_839_0_00);
174174
public static final TransportVersion ML_INFERENCE_IBM_WATSONX_RERANK_ADDED = def(8_840_0_00);
175+
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED_BACKPORT_8_X = def(8_840_0_01);
175176
public static final TransportVersion ELASTICSEARCH_9_0 = def(9_000_0_00);
176177
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED = def(9_001_0_00);
177178
/*

server/src/main/java/org/elasticsearch/index/mapper/InferenceMetadataFieldsMapper.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.elasticsearch.cluster.metadata.IndexMetadata;
1616
import org.elasticsearch.common.settings.Setting;
1717
import org.elasticsearch.common.settings.Settings;
18+
import org.elasticsearch.index.IndexVersion;
1819
import org.elasticsearch.index.IndexVersions;
1920
import org.elasticsearch.index.query.SearchExecutionContext;
2021

@@ -41,6 +42,10 @@ public abstract class InferenceMetadataFieldsMapper extends MetadataFieldMapper
4142
Setting.Property.InternalIndex
4243
);
4344

45+
// Check index version SOURCE_MAPPER_MODE_ATTRIBUTE_NOOP because that index version was added in the same serverless promotion
46+
// where the new format was enabled by default
47+
public static final IndexVersion USE_NEW_SEMANTIC_TEXT_FORMAT_BY_DEFAULT = IndexVersions.SOURCE_MAPPER_MODE_ATTRIBUTE_NOOP;
48+
4449
public static final String NAME = "_inference_fields";
4550
public static final String CONTENT_TYPE = "_inference_fields";
4651

@@ -86,10 +91,12 @@ public abstract ValueFetcher valueFetcher(
8691
*/
8792
public static boolean isEnabled(Settings settings) {
8893
var version = IndexMetadata.SETTING_INDEX_VERSION_CREATED.get(settings);
89-
if (version.before(IndexVersions.INFERENCE_METADATA_FIELDS)
90-
&& version.between(IndexVersions.INFERENCE_METADATA_FIELDS_BACKPORT, IndexVersions.UPGRADE_TO_LUCENE_10_0_0) == false) {
94+
if ((version.before(IndexVersions.INFERENCE_METADATA_FIELDS)
95+
&& version.between(IndexVersions.INFERENCE_METADATA_FIELDS_BACKPORT, IndexVersions.UPGRADE_TO_LUCENE_10_0_0) == false)
96+
|| (version.before(USE_NEW_SEMANTIC_TEXT_FORMAT_BY_DEFAULT) && USE_LEGACY_SEMANTIC_TEXT_FORMAT.exists(settings) == false)) {
9197
return false;
9298
}
99+
93100
return USE_LEGACY_SEMANTIC_TEXT_FORMAT.get(settings) == false;
94101
}
95102

test/external-modules/esql-heap-attack/src/javaRestTest/java/org/elasticsearch/xpack/esql/heap_attack/HeapAttackIT.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ public void testFetchMvLongs() throws IOException {
615615
assertMap(map, matchesMap().entry("columns", columns));
616616
}
617617

618-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/106683")
619618
public void testFetchTooManyMvLongs() throws IOException {
620619
initMvLongsIndex(500, 100, 1000);
621620
assertCircuitBreaks(() -> fetchMvLongs());
@@ -636,7 +635,8 @@ public void testLookupExplosion() throws IOException {
636635

637636
public void testLookupExplosionManyMatches() throws IOException {
638637
assertCircuitBreaks(() -> {
639-
Map<?, ?> result = lookupExplosion(1500, 10000);
638+
// 1500, 10000 is enough locally, but some CI machines need more.
639+
Map<?, ?> result = lookupExplosion(2000, 10000);
640640
logger.error("should have failed but got {}", result);
641641
});
642642
}
@@ -664,7 +664,8 @@ public void testLookupExplosionBigString() throws IOException {
664664

665665
public void testLookupExplosionBigStringManyMatches() throws IOException {
666666
assertCircuitBreaks(() -> {
667-
Map<?, ?> result = lookupExplosionBigString(500, 1);
667+
// 500, 1 is enough to make it fail locally but some CI needs more
668+
Map<?, ?> result = lookupExplosionBigString(800, 1);
668669
logger.error("should have failed but got {}", result);
669670
});
670671
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424

2525
public class FailingFieldPlugin extends Plugin implements ScriptPlugin {
2626

27+
public static final String FAILING_FIELD_LANG = "failing_field";
28+
2729
@Override
2830
public ScriptEngine getScriptEngine(Settings settings, Collection<ScriptContext<?>> contexts) {
2931
return new ScriptEngine() {
3032
@Override
3133
public String getType() {
32-
return "failing_field";
34+
return FAILING_FIELD_LANG;
3335
}
3436

3537
@Override

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@
1010
import org.elasticsearch.action.ActionRequestValidationException;
1111
import org.elasticsearch.action.ActionResponse;
1212
import org.elasticsearch.action.ActionType;
13-
import org.elasticsearch.action.support.master.MasterNodeRequest;
13+
import org.elasticsearch.action.support.local.LocalClusterStateRequest;
1414
import org.elasticsearch.common.io.stream.StreamInput;
1515
import org.elasticsearch.common.io.stream.StreamOutput;
1616
import org.elasticsearch.common.io.stream.Writeable;
1717
import org.elasticsearch.common.unit.ByteSizeValue;
1818
import org.elasticsearch.core.TimeValue;
19+
import org.elasticsearch.core.UpdateForV10;
20+
import org.elasticsearch.tasks.CancellableTask;
21+
import org.elasticsearch.tasks.Task;
22+
import org.elasticsearch.tasks.TaskId;
1923
import org.elasticsearch.tasks.TaskInfo;
2024
import org.elasticsearch.xcontent.ToXContentFragment;
2125
import org.elasticsearch.xcontent.ToXContentObject;
2226
import org.elasticsearch.xcontent.XContentBuilder;
2327

2428
import java.io.IOException;
2529
import java.util.List;
30+
import java.util.Map;
2631
import java.util.Objects;
2732

2833
public class EnrichStatsAction extends ActionType<EnrichStatsAction.Response> {
@@ -34,12 +39,17 @@ private EnrichStatsAction() {
3439
super(NAME);
3540
}
3641

37-
public static class Request extends MasterNodeRequest<Request> {
42+
public static class Request extends LocalClusterStateRequest {
3843

3944
public Request(TimeValue masterNodeTimeout) {
4045
super(masterNodeTimeout);
4146
}
4247

48+
/**
49+
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC we must remain able to read these requests until
50+
* we no longer need to support calling this action remotely.
51+
*/
52+
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
4353
public Request(StreamInput in) throws IOException {
4454
super(in);
4555
}
@@ -48,6 +58,11 @@ public Request(StreamInput in) throws IOException {
4858
public ActionRequestValidationException validate() {
4959
return null;
5060
}
61+
62+
@Override
63+
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) {
64+
return new CancellableTask(id, type, action, "", parentTaskId, headers);
65+
}
5166
}
5267

5368
public static class Response extends ActionResponse implements ToXContentObject {
@@ -62,13 +77,6 @@ public Response(List<ExecutingPolicy> executingPolicies, List<CoordinatorStats>
6277
this.cacheStats = cacheStats;
6378
}
6479

65-
public Response(StreamInput in) throws IOException {
66-
super(in);
67-
executingPolicies = in.readCollectionAsList(ExecutingPolicy::new);
68-
coordinatorStats = in.readCollectionAsList(CoordinatorStats::new);
69-
cacheStats = in.readCollectionAsList(CacheStats::new);
70-
}
71-
7280
public List<ExecutingPolicy> getExecutingPolicies() {
7381
return executingPolicies;
7482
}
@@ -81,6 +89,11 @@ public List<CacheStats> getCacheStats() {
8189
return cacheStats;
8290
}
8391

92+
/**
93+
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC we must remain able to write these responses until
94+
* we no longer need to support calling this action remotely.
95+
*/
96+
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
8497
@Override
8598
public void writeTo(StreamOutput out) throws IOException {
8699
out.writeCollection(executingPolicies);
@@ -167,10 +180,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
167180

168181
public record ExecutingPolicy(String name, TaskInfo taskInfo) implements Writeable, ToXContentFragment {
169182

170-
ExecutingPolicy(StreamInput in) throws IOException {
171-
this(in.readString(), TaskInfo.from(in));
172-
}
173-
183+
/**
184+
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC we must remain able to write these responses until
185+
* we no longer need to support calling this action remotely.
186+
*/
187+
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
174188
@Override
175189
public void writeTo(StreamOutput out) throws IOException {
176190
out.writeString(name);

0 commit comments

Comments
 (0)