Skip to content

Commit cdbb9ec

Browse files
Merge remote-tracking branch 'elastic/main' into remove-some-copies
2 parents 8ad77a5 + 9765251 commit cdbb9ec

File tree

32 files changed

+206
-363
lines changed

32 files changed

+206
-363
lines changed

docs/changelog/126805.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126805
2+
summary: Adding timeout to request for creating inference endpoint
3+
area: Machine Learning
4+
type: bug
5+
issues: []

docs/reference/elasticsearch/mapping-reference/keyword.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,42 @@ Will become:
232232
}
233233
```
234234

235+
If `null_value` is configured, `null` values are replaced with the `null_value` in synthetic source:
236+
237+
$$$synthetic-source-keyword-example-null-value$$$
238+
239+
```console
240+
PUT idx
241+
{
242+
"settings": {
243+
"index": {
244+
"mapping": {
245+
"source": {
246+
"mode": "synthetic"
247+
}
248+
}
249+
}
250+
},
251+
"mappings": {
252+
"properties": {
253+
"kwd": { "type": "keyword", "null_value": "NA" }
254+
}
255+
}
256+
}
257+
PUT idx/_doc/1
258+
{
259+
"kwd": ["foo", null, "bar"]
260+
}
261+
```
262+
263+
Will become:
264+
265+
```console-result
266+
{
267+
"kwd": ["bar", "foo", "NA"]
268+
}
269+
```
270+
235271

236272
## Constant keyword field type [constant-keyword-field-type]
237273

docs/reference/elasticsearch/mapping-reference/text.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,17 @@ Synthetic `_source` is Generally Available only for TSDB indices (indices that h
104104
::::
105105

106106

107-
`text` fields support [synthetic `_source`](/reference/elasticsearch/mapping-reference/mapping-source-field.md#synthetic-source) if they have a [`keyword`](/reference/elasticsearch/mapping-reference/keyword.md#keyword-synthetic-source) sub-field that supports synthetic `_source` or if the `text` field sets `store` to `true`. Either way, it may not have [`copy_to`](/reference/elasticsearch/mapping-reference/copy-to.md).
107+
`text` fields can use a [`keyword`](/reference/elasticsearch/mapping-reference/keyword.md#keyword-synthetic-source) sub-field to support [synthetic `_source`](/reference/elasticsearch/mapping-reference/mapping-source-field.md#synthetic-source) without storing values of the text field itself.
108108

109-
If using a sub-`keyword` field, then the values are sorted in the same way as a `keyword` field’s values are sorted. By default, that means sorted with duplicates removed. So:
109+
In this case, the synthetic source of the `text` field will have the same [modifications](/reference/elasticsearch/mapping-reference/mapping-source-field.md#synthetic-source) as a `keyword` field.
110110

111-
$$$synthetic-source-text-example-default$$$
111+
These modifications can impact usage of `text` fields:
112+
* Reordering text fields can have an effect on [phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) and [span](/reference/query-languages/query-dsl/span-queries.md) queries. See the discussion about [`position_increment_gap`](/reference/elasticsearch/mapping-reference/position-increment-gap.md) for more details. You can avoid this by making sure the `slop` parameter on the phrase queries is lower than the `position_increment_gap`. This is the default.
113+
* Handling of `null` values is different. `text` fields ignore `null` values, but `keyword` fields support replacing `null` values with a value specified in the `null_value` parameter. This replacement is represented in synthetic source.
114+
115+
For example:
116+
117+
$$$synthetic-source-text-example-multi-field$$$
112118

113119
```console
114120
PUT idx
@@ -127,8 +133,9 @@ PUT idx
127133
"text": {
128134
"type": "text",
129135
"fields": {
130-
"raw": {
131-
"type": "keyword"
136+
"kwd": {
137+
"type": "keyword",
138+
"null_value": "NA"
132139
}
133140
}
134141
}
@@ -138,9 +145,10 @@ PUT idx
138145
PUT idx/_doc/1
139146
{
140147
"text": [
148+
null,
141149
"the quick brown fox",
142150
"the quick brown fox",
143-
"jumped over the lazy dog"
151+
"jumped over the lazy dog",
144152
]
145153
}
146154
```
@@ -150,18 +158,15 @@ Will become:
150158
```console-result
151159
{
152160
"text": [
153-
"jumped over the lazy dog",
161+
"jumped over the lazy dog"
162+
"NA",
154163
"the quick brown fox"
155164
]
156165
}
157166
```
158167

159-
::::{note}
160-
Reordering text fields can have an effect on [phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) and [span](/reference/query-languages/query-dsl/span-queries.md) queries. See the discussion about [`position_increment_gap`](/reference/elasticsearch/mapping-reference/position-increment-gap.md) for more detail. You can avoid this by making sure the `slop` parameter on the phrase queries is lower than the `position_increment_gap`. This is the default.
161-
::::
162168

163-
164-
If the `text` field sets `store` to true then order and duplicates are preserved.
169+
If the `text` field sets `store` to `true` then the sub-field is not used and no modifications are applied. For example:
165170

166171
$$$synthetic-source-text-example-stored$$$
167172

@@ -179,7 +184,15 @@ PUT idx
179184
},
180185
"mappings": {
181186
"properties": {
182-
"text": { "type": "text", "store": true }
187+
"text": {
188+
"type": "text",
189+
"store": true,
190+
"fields": {
191+
"raw": {
192+
"type": "keyword"
193+
}
194+
}
195+
}
183196
}
184197
}
185198
}

docs/release-notes/breaking-changes.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ If you are migrating from a version prior to version 9.0, you must first upgrade
1313
% ## Next version [elasticsearch-nextversion-breaking-changes]
1414

1515
## 9.0.1 [elasticsearch-9.0.1-breaking-changes]
16-
```{applies_to}
17-
stack: coming 9.0.1
18-
```
1916

2017
No breaking changes in this version.
2118

docs/release-notes/deprecations.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ To give you insight into what deprecated features you’re using, {{es}}:
1717
% ## Next version [elasticsearch-nextversion-deprecations]
1818

1919
## 9.0.1 [elasticsearch-9.0.1-deprecations]
20-
```{applies_to}
21-
stack: coming 9.0.1
22-
```
2320

2421
No deprecations in this version.
2522

docs/release-notes/index.md

Lines changed: 0 additions & 3 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.1 [elasticsearch-9.0.1-release-notes]
24-
```{applies_to}
25-
stack: coming 9.0.1
26-
```
2724

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

modules/transport-netty4/src/internalClusterTest/java/org/elasticsearch/http/netty4/Netty4IncrementalRequestHandlingIT.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
import org.elasticsearch.common.util.CollectionUtils;
6262
import org.elasticsearch.core.Releasable;
6363
import org.elasticsearch.core.Releasables;
64+
import org.elasticsearch.core.TimeValue;
6465
import org.elasticsearch.features.NodeFeature;
6566
import org.elasticsearch.http.HttpBodyTracer;
6667
import org.elasticsearch.http.HttpServerTransport;
67-
import org.elasticsearch.http.HttpTransportSettings;
6868
import org.elasticsearch.index.IndexingPressure;
6969
import org.elasticsearch.plugins.ActionPlugin;
7070
import org.elasticsearch.plugins.Plugin;
@@ -107,6 +107,8 @@
107107
import static io.netty.handler.codec.http.HttpHeaderValues.APPLICATION_JSON;
108108
import static io.netty.handler.codec.http.HttpMethod.POST;
109109
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
110+
import static org.elasticsearch.http.HttpTransportSettings.SETTING_HTTP_CLIENT_STATS_MAX_CLOSED_CHANNEL_AGE;
111+
import static org.elasticsearch.http.HttpTransportSettings.SETTING_HTTP_MAX_CONTENT_LENGTH;
110112
import static org.hamcrest.Matchers.anEmptyMap;
111113
import static org.hamcrest.Matchers.empty;
112114
import static org.hamcrest.Matchers.greaterThan;
@@ -120,12 +122,13 @@ public class Netty4IncrementalRequestHandlingIT extends ESNetty4IntegTestCase {
120122

121123
@Override
122124
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
123-
Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
124-
builder.put(
125-
HttpTransportSettings.SETTING_HTTP_MAX_CONTENT_LENGTH.getKey(),
126-
ByteSizeValue.of(MAX_CONTENT_LENGTH, ByteSizeUnit.BYTES)
127-
);
128-
return builder.build();
125+
return Settings.builder()
126+
.put(super.nodeSettings(nodeOrdinal, otherSettings))
127+
// reduce max content length just to cut down test duration
128+
.put(SETTING_HTTP_MAX_CONTENT_LENGTH.getKey(), ByteSizeValue.of(MAX_CONTENT_LENGTH, ByteSizeUnit.BYTES))
129+
// disable time-based expiry of channel stats since we assert that the total request size accumulates
130+
.put(SETTING_HTTP_CLIENT_STATS_MAX_CLOSED_CHANNEL_AGE.getKey(), TimeValue.MAX_VALUE)
131+
.build();
129132
}
130133

131134
// ensure empty http content has single 0 size chunk
@@ -436,7 +439,7 @@ public void testHttpClientStats() throws Exception {
436439
clientContext.channel().writeAndFlush(httpRequest(opaqueId, contentSize));
437440
clientContext.channel().writeAndFlush(randomContent(contentSize, true));
438441
final var handler = clientContext.awaitRestChannelAccepted(opaqueId);
439-
handler.readAllBytes();
442+
assertEquals(contentSize, handler.readAllBytes());
440443
handler.sendResponse(new RestResponse(RestStatus.OK, ""));
441444
assertEquals(totalBytesSent, clientContext.transportStatsRequestBytesSize());
442445
}

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ tests:
441441
- class: org.elasticsearch.xpack.esql.optimizer.OptimizerRulesTests
442442
method: testOptimizerExpressionRuleShouldNotVisitExcludedNodes
443443
issue: https://github.com/elastic/elasticsearch/issues/127754
444+
- class: org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityFcActionAuthorizationIT
445+
method: testIndicesPrivilegesAreEnforcedForCcrRestoreSessionActions
446+
issue: https://github.com/elastic/elasticsearch/issues/127782
444447

445448
# Examples:
446449
#

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ static TransportVersion def(int id) {
172172
public static final TransportVersion INTRODUCE_FAILURES_LIFECYCLE_BACKPORT_8_19 = def(8_841_0_25);
173173
public static final TransportVersion INTRODUCE_FAILURES_DEFAULT_RETENTION_BACKPORT_8_19 = def(8_841_0_26);
174174
public static final TransportVersion RESCORE_VECTOR_ALLOW_ZERO_BACKPORT_8_19 = def(8_841_0_27);
175+
public static final TransportVersion INFERENCE_ADD_TIMEOUT_PUT_ENDPOINT_8_19 = def(8_841_0_28);
175176
public static final TransportVersion V_9_0_0 = def(9_000_0_09);
176177
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
177178
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);
@@ -248,6 +249,7 @@ static TransportVersion def(int id) {
248249
public static final TransportVersion INTRODUCE_FAILURES_DEFAULT_RETENTION = def(9_071_0_00);
249250
public static final TransportVersion FILE_SETTINGS_HEALTH_INFO = def(9_072_0_00);
250251
public static final TransportVersion FIELD_CAPS_ADD_CLUSTER_ALIAS = def(9_073_0_00);
252+
public static final TransportVersion INFERENCE_ADD_TIMEOUT_PUT_ENDPOINT = def(9_074_00_0);
251253

252254
/*
253255
* STOP! READ THIS FIRST! No, really,

server/src/main/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.elasticsearch.action.support.IndicesOptions;
2424
import org.elasticsearch.client.internal.Client;
2525
import org.elasticsearch.cluster.ClusterState;
26-
import org.elasticsearch.common.bytes.ReleasableBytesReference;
2726
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
2827
import org.elasticsearch.common.io.stream.RecyclerBytesStreamOutput;
2928
import org.elasticsearch.common.io.stream.StreamInput;
@@ -820,7 +819,7 @@ void onShardDone() {
820819
out.close();
821820
}
822821
}
823-
ActionListener.respondAndRelease(channelListener, new BytesTransportResponse(new ReleasableBytesReference(out.bytes(), out)));
822+
ActionListener.respondAndRelease(channelListener, new BytesTransportResponse(out.moveToBytesReference()));
824823
}
825824

826825
private void maybeFreeContext(SearchPhaseResult result, BitSet relevantShardIndices) {

0 commit comments

Comments
 (0)