Skip to content

Commit 519364b

Browse files
authored
Merge branch 'main' into fix/testApmIntegration-2
2 parents e7dec67 + bc515c4 commit 519364b

File tree

13 files changed

+366
-140
lines changed

13 files changed

+366
-140
lines changed

docs/release-notes/breaking-changes.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,15 @@ If you are migrating from a version prior to version 9.0, you must first upgrade
1212

1313
% ## Next version [elasticsearch-nextversion-breaking-changes]
1414

15-
```{applies_to}
16-
stack: coming 9.0.3
17-
```
1815
## 9.0.3 [elasticsearch-9.0.3-breaking-changes]
1916

2017
No breaking changes in this version.
2118

22-
```{applies_to}
23-
stack: coming 9.0.2
24-
```
2519
## 9.0.2 [elasticsearch-9.0.2-breaking-changes]
2620

2721
Snapshot/Restore:
2822
* Make S3 custom query parameter optional [#128043](https://github.com/elastic/elasticsearch/pull/128043)
2923

30-
31-
3224
## 9.0.1 [elasticsearch-9.0.1-breaking-changes]
3325

3426
No breaking changes in this version.

docs/release-notes/changelog-bundles/9.0.2.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 9.0.2
2-
released: false
3-
generated: 2025-05-22T15:14:00.768080Z
2+
released: true
3+
generated: 2025-06-03T14:58:36.937148609Z
44
changelogs:
55
- pr: 126992
66
summary: Add missing `outbound_network` entitlement to x-pack-core
@@ -36,6 +36,12 @@ changelogs:
3636
type: bug
3737
issues:
3838
- 127468
39+
- pr: 127564
40+
summary: Consider inlinestats when having `field_caps` check for field names
41+
area: ES|QL
42+
type: bug
43+
issues:
44+
- 127236
3945
- pr: 127658
4046
summary: Append all data to Chat Completion buffer
4147
area: Machine Learning
@@ -133,3 +139,31 @@ changelogs:
133139
area: Data streams
134140
type: bug
135141
issues: []
142+
- pr: 128259
143+
summary: Added geometry validation for GEO types to exit early on invalid latitudes
144+
area: Geo
145+
type: bug
146+
issues:
147+
- 128234
148+
- pr: 128260
149+
summary: Fix validation NPE in Enrich and add extra @Nullable annotations
150+
area: ES|QL
151+
type: bug
152+
issues:
153+
- 126297
154+
- 126253
155+
- pr: 128320
156+
summary: Use new source loader when lower `docId` is accessed
157+
area: Codec
158+
type: bug
159+
issues: []
160+
- pr: 128327
161+
summary: Use internal user for internal inference action
162+
area: Machine Learning
163+
type: bug
164+
issues: []
165+
- pr: 128338
166+
summary: Pass timeout to chat completion
167+
area: Machine Learning
168+
type: bug
169+
issues: []

docs/release-notes/changelog-bundles/9.0.3.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 9.0.3
2-
released: false
3-
generated: 2025-06-21T00:06:16.346021604Z
2+
released: true
3+
generated: 2025-06-24T15:19:29.859630035Z
44
changelogs:
55
- pr: 120869
66
summary: Threadpool merge scheduler

docs/release-notes/deprecations.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,11 @@ To give you insight into what deprecated features you’re using, {{es}}:
1616

1717
% ## Next version [elasticsearch-nextversion-deprecations]
1818

19-
```{applies_to}
20-
stack: coming 9.0.3
21-
```
2219
## 9.0.3 [elasticsearch-9.0.3-deprecations]
2320

2421
Engine:
2522
* Deprecate `indices.merge.scheduler.use_thread_pool` setting [#129464](https://github.com/elastic/elasticsearch/pull/129464)
2623

27-
28-
29-
```{applies_to}
30-
stack: coming 9.0.2
31-
```
3224
## 9.0.2 [elasticsearch-9.0.2-deprecations]
3325

3426
No deprecations in this version.

docs/release-notes/index.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ To check for security updates, go to [Security announcements for the Elastic sta
2121
% *
2222

2323
## 9.0.3 [elasticsearch-9.0.3-release-notes]
24-
```{applies_to}
25-
stack: coming 9.0.3
26-
```
2724

2825
### Features and enhancements [elasticsearch-9.0.3-features-enhancements]
2926

@@ -92,11 +89,7 @@ Searchable Snapshots:
9289
Security:
9390
* Fix error message when changing the password for a user in the file realm [#127621](https://github.com/elastic/elasticsearch/pull/127621)
9491

95-
9692
## 9.0.2 [elasticsearch-9.0.2-release-notes]
97-
```{applies_to}
98-
stack: coming 9.0.2
99-
```
10093

10194
### Features and enhancements [elasticsearch-9.0.2-features-enhancements]
10295

@@ -114,19 +107,27 @@ Aggregations:
114107
Audit:
115108
* Handle streaming request body in audit log [#127798](https://github.com/elastic/elasticsearch/pull/127798)
116109

110+
Codec:
111+
* Use new source loader when lower `docId` is accessed [#128320](https://github.com/elastic/elasticsearch/pull/128320)
112+
117113
Data streams:
118114
* Fix system data streams incorrectly showing up in the list of template validation problems [#128161](https://github.com/elastic/elasticsearch/pull/128161)
119115

120116
Downsampling:
121117
* Downsampling does not consider passthrough fields as dimensions [#127752](https://github.com/elastic/elasticsearch/pull/127752) (issue: [#125156](https://github.com/elastic/elasticsearch/issues/125156))
122118

123119
ES|QL:
120+
* Consider inlinestats when having `field_caps` check for field names [#127564](https://github.com/elastic/elasticsearch/pull/127564) (issue: [#127236](https://github.com/elastic/elasticsearch/issues/127236))
124121
* Don't push down filters on the right hand side of an inlinejoin [#127383](https://github.com/elastic/elasticsearch/pull/127383)
125122
* ESQL: Avoid unintended attribute removal [#127563](https://github.com/elastic/elasticsearch/pull/127563) (issue: [#127468](https://github.com/elastic/elasticsearch/issues/127468))
126123
* ESQL: Fix alias removal in regex extraction with JOIN [#127687](https://github.com/elastic/elasticsearch/pull/127687) (issue: [#127467](https://github.com/elastic/elasticsearch/issues/127467))
127124
* ESQL: Keep `DROP` attributes when resolving field names [#127009](https://github.com/elastic/elasticsearch/pull/127009) (issue: [#126418](https://github.com/elastic/elasticsearch/issues/126418))
128125
* Ensure ordinal builder emit ordinal blocks [#127949](https://github.com/elastic/elasticsearch/pull/127949)
129126
* Fix union types in CCS [#128111](https://github.com/elastic/elasticsearch/pull/128111)
127+
* Fix validation NPE in Enrich and add extra @Nullable annotations [#128260](https://github.com/elastic/elasticsearch/pull/128260) (issues: [#126297](https://github.com/elastic/elasticsearch/issues/126297), [#126253](https://github.com/elastic/elasticsearch/issues/126253))
128+
129+
Geo:
130+
* Added geometry validation for GEO types to exit early on invalid latitudes [#128259](https://github.com/elastic/elasticsearch/pull/128259) (issue: [#128234](https://github.com/elastic/elasticsearch/issues/128234))
130131

131132
Infra/Core:
132133
* Add missing `outbound_network` entitlement to x-pack-core [#126992](https://github.com/elastic/elasticsearch/pull/126992) (issue: [#127003](https://github.com/elastic/elasticsearch/issues/127003))
@@ -138,6 +139,8 @@ Infra/Scripting:
138139
Machine Learning:
139140
* Append all data to Chat Completion buffer [#127658](https://github.com/elastic/elasticsearch/pull/127658)
140141
* Fix services API Google Vertex AI Rerank location field requirement [#127856](https://github.com/elastic/elasticsearch/pull/127856)
142+
* Pass timeout to chat completion [#128338](https://github.com/elastic/elasticsearch/pull/128338)
143+
* Use internal user for internal inference action [#128327](https://github.com/elastic/elasticsearch/pull/128327)
141144

142145
Relevance:
143146
* Fix: Add `NamedWriteable` for `RuleQueryRankDoc` [#128153](https://github.com/elastic/elasticsearch/pull/128153) (issue: [#126071](https://github.com/elastic/elasticsearch/issues/126071))
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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.core;
11+
12+
import java.lang.annotation.ElementType;
13+
import java.lang.annotation.Retention;
14+
import java.lang.annotation.RetentionPolicy;
15+
import java.lang.annotation.Target;
16+
17+
/**
18+
* Annotation to identify a block of code (a whole class, a method, a field, or a local variable) that is intentionally not fully
19+
* project-aware because it's not intended to be used in a serverless environment. Some features are unavailable in serverless and are
20+
* thus not worth the investment to make fully project-aware. This annotation makes it easier to identify blocks of code that require
21+
* attention in case those features are revisited from a multi-project POV.
22+
*/
23+
@Retention(RetentionPolicy.SOURCE)
24+
@Target(
25+
{ ElementType.LOCAL_VARIABLE, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.MODULE }
26+
)
27+
public @interface NotMultiProjectCapable {
28+
29+
/**
30+
* Some explanation on why the block of code would not work in a multi-project context and/or what would need to be done to make it
31+
* properly project-aware.
32+
*/
33+
String description() default "";
34+
}

muted-tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,12 @@ tests:
561561
method: "builds distribution from branches via archives extractedAssemble [bwcDistVersion: 8.2.1, bwcProject: bugfix, expectedAssembleTaskName:
562562
extractedAssemble, #2]"
563563
issue: https://github.com/elastic/elasticsearch/issues/119871
564-
564+
- class: org.elasticsearch.xpack.inference.qa.mixed.CohereServiceMixedIT
565+
method: testRerank
566+
issue: https://github.com/elastic/elasticsearch/issues/130009
567+
- class: org.elasticsearch.xpack.inference.qa.mixed.CohereServiceMixedIT
568+
method: testCohereEmbeddings
569+
issue: https://github.com/elastic/elasticsearch/issues/130010
565570

566571
# Examples:
567572
#

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/EsPhysicalOperationProviders.java

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77

88
package org.elasticsearch.xpack.esql.planner;
99

10+
import org.apache.lucene.document.FieldType;
11+
import org.apache.lucene.index.DocValuesType;
12+
import org.apache.lucene.index.IndexOptions;
1013
import org.apache.lucene.index.LeafReaderContext;
1114
import org.apache.lucene.index.SortedSetDocValues;
1215
import org.apache.lucene.search.BooleanClause;
1316
import org.apache.lucene.search.BooleanQuery;
1417
import org.apache.lucene.search.IndexSearcher;
1518
import org.apache.lucene.search.Query;
1619
import org.elasticsearch.common.logging.HeaderWarning;
20+
import org.elasticsearch.common.lucene.Lucene;
1721
import org.elasticsearch.compute.aggregation.AggregatorMode;
1822
import org.elasticsearch.compute.aggregation.GroupingAggregator;
1923
import org.elasticsearch.compute.aggregation.blockhash.BlockHash;
@@ -76,7 +80,6 @@
7680
import java.io.IOException;
7781
import java.util.ArrayList;
7882
import java.util.List;
79-
import java.util.Map;
8083
import java.util.Optional;
8184
import java.util.Set;
8285
import java.util.function.Function;
@@ -177,6 +180,13 @@ private BlockLoader getBlockLoaderFor(int shardId, Attribute attr, MappedFieldTy
177180

178181
/** A hack to pretend an unmapped field still exists. */
179182
private static class DefaultShardContextForUnmappedField extends DefaultShardContext {
183+
private static final FieldType UNMAPPED_FIELD_TYPE = new FieldType(KeywordFieldMapper.Defaults.FIELD_TYPE);
184+
static {
185+
UNMAPPED_FIELD_TYPE.setDocValuesType(DocValuesType.NONE);
186+
UNMAPPED_FIELD_TYPE.setIndexOptions(IndexOptions.NONE);
187+
UNMAPPED_FIELD_TYPE.setStored(false);
188+
UNMAPPED_FIELD_TYPE.freeze();
189+
}
180190
private final KeywordEsField unmappedEsField;
181191

182192
DefaultShardContextForUnmappedField(DefaultShardContext ctx, PotentiallyUnmappedKeywordEsField unmappedEsField) {
@@ -187,9 +197,22 @@ private static class DefaultShardContextForUnmappedField extends DefaultShardCon
187197
@Override
188198
public @Nullable MappedFieldType fieldType(String name) {
189199
var superResult = super.fieldType(name);
190-
return superResult == null && name.equals(unmappedEsField.getName())
191-
? new KeywordFieldMapper.KeywordFieldType(name, false /* isIndexed */, false /* hasDocValues */, Map.of() /* meta */)
192-
: superResult;
200+
return superResult == null && name.equals(unmappedEsField.getName()) ? createUnmappedFieldType(name, this) : superResult;
201+
}
202+
203+
static MappedFieldType createUnmappedFieldType(String name, DefaultShardContext context) {
204+
var builder = new KeywordFieldMapper.Builder(name, context.ctx.indexVersionCreated());
205+
builder.docValues(false);
206+
builder.indexed(false);
207+
return new KeywordFieldMapper.KeywordFieldType(
208+
name,
209+
UNMAPPED_FIELD_TYPE,
210+
Lucene.KEYWORD_ANALYZER,
211+
Lucene.KEYWORD_ANALYZER,
212+
Lucene.KEYWORD_ANALYZER,
213+
builder,
214+
context.ctx.isSourceSynthetic()
215+
);
193216
}
194217
}
195218

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlannerTests.java

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@
2323
import org.elasticsearch.compute.lucene.DataPartitioning;
2424
import org.elasticsearch.compute.lucene.LuceneSourceOperator;
2525
import org.elasticsearch.compute.lucene.LuceneTopNSourceOperator;
26+
import org.elasticsearch.compute.lucene.ValuesSourceReaderOperator;
2627
import org.elasticsearch.compute.operator.SourceOperator;
2728
import org.elasticsearch.compute.test.TestBlockFactory;
2829
import org.elasticsearch.core.IOUtils;
2930
import org.elasticsearch.core.Releasable;
3031
import org.elasticsearch.core.Releasables;
3132
import org.elasticsearch.index.IndexMode;
3233
import org.elasticsearch.index.cache.query.TrivialQueryCachingPolicy;
34+
import org.elasticsearch.index.mapper.BlockLoader;
35+
import org.elasticsearch.index.mapper.BlockSourceReader;
36+
import org.elasticsearch.index.mapper.FallbackSyntheticSourceBlockLoader;
37+
import org.elasticsearch.index.mapper.MappedFieldType;
3338
import org.elasticsearch.index.mapper.MapperServiceTestCase;
3439
import org.elasticsearch.node.Node;
3540
import org.elasticsearch.plugins.ExtensiblePlugin;
@@ -42,10 +47,12 @@
4247
import org.elasticsearch.xpack.esql.core.tree.Source;
4348
import org.elasticsearch.xpack.esql.core.type.DataType;
4449
import org.elasticsearch.xpack.esql.core.type.EsField;
50+
import org.elasticsearch.xpack.esql.core.type.PotentiallyUnmappedKeywordEsField;
4551
import org.elasticsearch.xpack.esql.core.util.StringUtils;
4652
import org.elasticsearch.xpack.esql.expression.Order;
4753
import org.elasticsearch.xpack.esql.index.EsIndex;
4854
import org.elasticsearch.xpack.esql.plan.physical.EsQueryExec;
55+
import org.elasticsearch.xpack.esql.plan.physical.FieldExtractExec;
4956
import org.elasticsearch.xpack.esql.plan.physical.LimitExec;
5057
import org.elasticsearch.xpack.esql.plan.physical.ParallelExec;
5158
import org.elasticsearch.xpack.esql.plugin.EsqlPlugin;
@@ -64,6 +71,7 @@
6471

6572
import static org.hamcrest.Matchers.equalTo;
6673
import static org.hamcrest.Matchers.hasSize;
74+
import static org.hamcrest.Matchers.instanceOf;
6775
import static org.hamcrest.Matchers.lessThanOrEqualTo;
6876

6977
public class LocalExecutionPlannerTests extends MapperServiceTestCase {
@@ -84,10 +92,17 @@ public static Iterable<Object[]> parameters() throws Exception {
8492

8593
private final ArrayList<Releasable> releasables = new ArrayList<>();
8694

95+
private Settings settings = SETTINGS;
96+
8797
public LocalExecutionPlannerTests(@Name("estimatedRowSizeIsHuge") boolean estimatedRowSizeIsHuge) {
8898
this.estimatedRowSizeIsHuge = estimatedRowSizeIsHuge;
8999
}
90100

101+
@Override
102+
protected Settings getIndexSettings() {
103+
return settings;
104+
}
105+
91106
@Override
92107
protected Collection<Plugin> getPlugins() {
93108
var plugin = new SpatialPlugin();
@@ -229,6 +244,47 @@ public void testParallel() throws Exception {
229244
assertThat(plan.driverFactories, hasSize(2));
230245
}
231246

247+
public void testPlanUnmappedFieldExtractStoredSource() throws Exception {
248+
var blockLoader = constructBlockLoader();
249+
// In case of stored source we expect bytes based block source loader (this loads source from _source)
250+
assertThat(blockLoader, instanceOf(BlockSourceReader.BytesRefsBlockLoader.class));
251+
}
252+
253+
public void testPlanUnmappedFieldExtractSyntheticSource() throws Exception {
254+
// Enables synthetic source, so that fallback synthetic source blocker loader is used:
255+
settings = Settings.builder().put(settings).put("index.mapping.source.mode", "synthetic").build();
256+
257+
var blockLoader = constructBlockLoader();
258+
// In case of synthetic source we expect bytes based block source loader (this loads source from _ignored_source)
259+
assertThat(blockLoader, instanceOf(FallbackSyntheticSourceBlockLoader.class));
260+
}
261+
262+
private BlockLoader constructBlockLoader() throws IOException {
263+
EsQueryExec queryExec = new EsQueryExec(
264+
Source.EMPTY,
265+
index().name(),
266+
IndexMode.STANDARD,
267+
index().indexNameWithModes(),
268+
List.of(new FieldAttribute(Source.EMPTY, EsQueryExec.DOC_ID_FIELD.getName(), EsQueryExec.DOC_ID_FIELD)),
269+
null,
270+
null,
271+
null,
272+
between(1, 1000)
273+
);
274+
FieldExtractExec fieldExtractExec = new FieldExtractExec(
275+
Source.EMPTY,
276+
queryExec,
277+
List.of(
278+
new FieldAttribute(Source.EMPTY, "potentially_unmapped", new PotentiallyUnmappedKeywordEsField("potentially_unmapped"))
279+
),
280+
MappedFieldType.FieldExtractPreference.NONE
281+
);
282+
LocalExecutionPlanner.LocalExecutionPlan plan = planner().plan("test", FoldContext.small(), fieldExtractExec);
283+
var p = plan.driverFactories.get(0).driverSupplier().physicalOperation();
284+
var fieldInfo = ((ValuesSourceReaderOperator.Factory) p.intermediateOperatorFactories.get(0)).fields().get(0);
285+
return fieldInfo.blockLoader().apply(0);
286+
}
287+
232288
private int randomEstimatedRowSize(boolean huge) {
233289
int hugeBoundary = SourceOperator.MIN_TARGET_PAGE_SIZE * 10;
234290
return huge ? between(hugeBoundary, Integer.MAX_VALUE) : between(1, hugeBoundary);

0 commit comments

Comments
 (0)