Skip to content

Commit d99ab73

Browse files
authored
Merge branch 'main' into create-es-landing-page
2 parents e4945ea + 4950636 commit d99ab73

File tree

30 files changed

+237
-148
lines changed

30 files changed

+237
-148
lines changed

.ci/scripts/resolve-dra-manifest.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ strip_version() {
66
}
77

88
fetch_build() {
9-
curl -sS https://artifacts-$1.elastic.co/$2/latest/$3.json \
9+
>&2 echo "Checking for build id: https://artifacts-$1.elastic.co/$2/latest/$3.json"
10+
curl -sSf https://artifacts-$1.elastic.co/$2/latest/$3.json \
1011
| jq -r '.build_id'
1112
}
1213

@@ -15,7 +16,15 @@ BRANCH="${BRANCH:-$2}"
1516
ES_VERSION="${ES_VERSION:-$3}"
1617
WORKFLOW=${WORKFLOW:-$4}
1718

18-
LATEST_BUILD=$(fetch_build $WORKFLOW $ARTIFACT $BRANCH)
19+
if [[ "$WORKFLOW" == "staging" ]]; then
20+
LATEST_BUILD=$(fetch_build $WORKFLOW $ARTIFACT $ES_VERSION)
21+
elif [[ "$WORKFLOW" == "snapshot" ]]; then
22+
LATEST_BUILD=$(fetch_build $WORKFLOW $ARTIFACT $BRANCH)
23+
else
24+
echo "Unknown workflow: $WORKFLOW"
25+
exit 1
26+
fi
27+
1928
LATEST_VERSION=$(strip_version $LATEST_BUILD)
2029

2130
# If the latest artifact version doesn't match what we expect, try the corresponding version branch.

docs/changelog/130083.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 130083
2+
summary: Fix timeout bug in DBQ deletion of unused and orphan ML data
3+
area: Machine Learning
4+
type: bug
5+
issues: []

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

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -112,32 +112,11 @@ to create the endpoint. If not specified, the {{infer}} endpoint defined by
112112
`inference_id` will be used at both index and query time.
113113

114114
`index_options`
115-
: (Optional, string) Specifies the index options to override default values
115+
: (Optional, object) Specifies the index options to override default values
116116
for the field. Currently, `dense_vector` index options are supported.
117117
For text embeddings, `index_options` may match any allowed
118118
[dense_vector index options](/reference/elasticsearch/mapping-reference/dense-vector.md#dense-vector-index-options).
119119

120-
An example of how to set index_options for a `semantic_text` field:
121-
122-
```console
123-
PUT my-index-000004
124-
{
125-
"mappings": {
126-
"properties": {
127-
"inference_field": {
128-
"type": "semantic_text",
129-
"inference_id": "my-text-embedding-endpoint",
130-
"index_options": {
131-
"dense_vector": {
132-
"type": "int4_flat"
133-
}
134-
}
135-
}
136-
}
137-
}
138-
}
139-
```
140-
141120
`chunking_settings`
142121
: (Optional, object) Settings for chunking text into smaller passages.
143122
If specified, these will override the chunking settings set in the {{infer-cap}}
@@ -165,7 +144,7 @@ To completely disable chunking, use the `none` chunking strategy.
165144
or `1`. Required for `sentence` type chunking settings
166145

167146
::::{warning}
168-
If the input exceeds the maximum token limit of the underlying model, some
147+
When using the `none` chunking strategy, if the input exceeds the maximum token limit of the underlying model, some
169148
services (such as OpenAI) may return an
170149
error. In contrast, the `elastic` and `elasticsearch` services will
171150
automatically truncate the input to fit within the
@@ -315,18 +294,38 @@ specified. It enables you to quickstart your semantic search by providing
315294
automatic {{infer}} and a dedicated query so you don’t need to provide further
316295
details.
317296

318-
In case you want to customize data indexing, use the [
319-
`sparse_vector`](/reference/elasticsearch/mapping-reference/sparse-vector.md)
320-
or [`dense_vector`](/reference/elasticsearch/mapping-reference/dense-vector.md)
321-
field types and create an ingest pipeline with
322-
an [{{infer}} processor](/reference/enrich-processor/inference-processor.md) to
323-
generate the
324-
embeddings. [This tutorial](docs-content://solutions/search/semantic-search/semantic-search-inference.md)
325-
walks you through the process. In these cases - when you use `sparse_vector` or
326-
`dense_vector` field types instead of the `semantic_text` field type to
327-
customize indexing - using the [
328-
`semantic_query`](/reference/query-languages/query-dsl/query-dsl-semantic-query.md)
329-
is not supported for querying the field data.
297+
If you want to override those defaults and customize the embeddings that
298+
`semantic_text` indexes, you can do so by modifying <<semantic-text-params,
299+
parameters>>:
300+
301+
- Use `index_options` to specify alternate index options such as specific
302+
`dense_vector` quantization methods
303+
- Use `chunking_settings` to override the chunking strategy associated with the
304+
{{infer}} endpoint, or completely disable chunking using the `none` type
305+
306+
Here is an example of how to set these parameters for a text embedding endpoint:
307+
308+
```console
309+
PUT my-index-000004
310+
{
311+
"mappings": {
312+
"properties": {
313+
"inference_field": {
314+
"type": "semantic_text",
315+
"inference_id": "my-text-embedding-endpoint",
316+
"index_options": {
317+
"dense_vector": {
318+
"type": "int4_flat"
319+
}
320+
},
321+
"chunking_settings": {
322+
"type": "none"
323+
}
324+
}
325+
}
326+
}
327+
}
328+
```
330329

331330
## Updates to `semantic_text` fields [update-script]
332331

muted-tests.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,6 @@ tests:
473473
- class: org.elasticsearch.packaging.test.DockerTests
474474
method: test081SymlinksAreFollowedWithEnvironmentVariableFiles
475475
issue: https://github.com/elastic/elasticsearch/issues/128867
476-
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests
477-
method: testAvailableDiskSpaceMonitorWhenFileSystemStatErrors
478-
issue: https://github.com/elastic/elasticsearch/issues/129149
479476
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeForkIT
480477
method: test {lookup-join.EnrichLookupStatsBug ASYNC}
481478
issue: https://github.com/elastic/elasticsearch/issues/129228
@@ -545,9 +542,6 @@ tests:
545542
- class: org.elasticsearch.qa.verify_version_constants.VerifyVersionConstantsIT
546543
method: testLuceneVersionConstant
547544
issue: https://github.com/elastic/elasticsearch/issues/125638
548-
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
549-
method: test
550-
issue: https://github.com/elastic/elasticsearch/issues/129819
551545
- class: org.elasticsearch.index.store.FsDirectoryFactoryTests
552546
method: testPreload
553547
issue: https://github.com/elastic/elasticsearch/issues/129852
@@ -569,15 +563,17 @@ tests:
569563
issue: https://github.com/elastic/elasticsearch/issues/130010
570564
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
571565
issue: https://github.com/elastic/elasticsearch/issues/128224
572-
- class: org.elasticsearch.xpack.autoscaling.storage.ReactiveStorageIT
573-
method: testScaleDuringSplitOrClone
574-
issue: https://github.com/elastic/elasticsearch/issues/130044
575-
- class: org.elasticsearch.cluster.metadata.ComposableIndexTemplateTests
576-
method: testMergeEmptyMappingsIntoTemplateWithNonEmptySettings
577-
issue: https://github.com/elastic/elasticsearch/issues/130050
578566
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
579567
method: test
580568
issue: https://github.com/elastic/elasticsearch/issues/130067
569+
- class: geoip.GeoIpMultiProjectIT
570+
issue: https://github.com/elastic/elasticsearch/issues/130073
571+
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
572+
method: test
573+
issue: https://github.com/elastic/elasticsearch/issues/130067
574+
- class: org.elasticsearch.xpack.esql.action.EnrichIT
575+
method: testTopN
576+
issue: https://github.com/elastic/elasticsearch/issues/130122
581577

582578
# Examples:
583579
#

qa/mixed-cluster/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ apply plugin: 'elasticsearch.rest-resources'
2323

2424
dependencies {
2525
restTestConfig project(path: ':modules:aggregations', configuration: 'restTests')
26+
restTestConfig project(path: ':modules:mapper-extras', configuration: 'restTests')
2627
}
2728

2829
restResources {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ static TransportVersion def(int id) {
208208
public static final TransportVersion SPARSE_VECTOR_FIELD_PRUNING_OPTIONS_8_19 = def(8_841_0_58);
209209
public static final TransportVersion ML_INFERENCE_ELASTIC_DENSE_TEXT_EMBEDDINGS_ADDED_8_19 = def(8_841_0_59);
210210
public static final TransportVersion ML_INFERENCE_COHERE_API_VERSION_8_19 = def(8_841_0_60);
211+
public static final TransportVersion ESQL_DOCUMENTS_FOUND_AND_VALUES_LOADED_8_19 = def(8_841_0_61);
211212
public static final TransportVersion V_9_0_0 = def(9_000_0_09);
212213
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
213214
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);

server/src/main/java/org/elasticsearch/index/engine/Engine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,7 @@ public void close() throws IOException {
21992199
awaitPendingClose();
22002200
}
22012201

2202-
private void awaitPendingClose() {
2202+
protected final void awaitPendingClose() {
22032203
try {
22042204
closedLatch.await();
22052205
} catch (InterruptedException e) {

server/src/test/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateTests.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,12 @@ public void testMergeEmptyMappingsIntoTemplateWithNonEmptySettings() throws IOEx
352352
// Attempting to merge in null mappings ought to fail
353353
ComposableIndexTemplate indexTemplate = randomInstance();
354354
expectThrows(NullPointerException.class, () -> indexTemplate.mergeMappings(null));
355-
assertThat(indexTemplate.mergeMappings(EMPTY_MAPPINGS), equalTo(indexTemplate));
355+
ComposableIndexTemplate mergedTemplate = indexTemplate.mergeMappings(EMPTY_MAPPINGS);
356+
if (indexTemplate.template() == null || indexTemplate.template().mappings() == null) {
357+
assertThat(mergedTemplate.template().mappings(), equalTo(EMPTY_MAPPINGS));
358+
} else {
359+
assertThat(mergedTemplate, equalTo(indexTemplate));
360+
}
356361
assertThat(indexTemplate.mergeSettings(Settings.EMPTY), equalTo(indexTemplate));
357362
}
358363

server/src/test/java/org/elasticsearch/index/engine/ThreadPoolMergeExecutorServiceDiskSpaceTests.java

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,19 @@ public void testDiskSpaceMonitorStartsAsDisabled() throws Exception {
324324
}
325325

326326
public void testAvailableDiskSpaceMonitorWhenFileSystemStatErrors() throws Exception {
327-
aFileStore.usableSpace = randomLongBetween(1L, 100L);
328-
aFileStore.totalSpace = randomLongBetween(1L, 100L);
329-
bFileStore.usableSpace = randomLongBetween(1L, 100L);
330-
bFileStore.totalSpace = randomLongBetween(1L, 100L);
327+
long aUsableSpace;
328+
long bUsableSpace;
329+
do {
330+
aFileStore.usableSpace = randomLongBetween(1L, 1000L);
331+
aFileStore.totalSpace = randomLongBetween(1L, 1000L);
332+
bFileStore.usableSpace = randomLongBetween(1L, 1000L);
333+
bFileStore.totalSpace = randomLongBetween(1L, 1000L);
334+
// the default 5% (same as flood stage level)
335+
aUsableSpace = Math.max(aFileStore.usableSpace - aFileStore.totalSpace / 20, 0L);
336+
bUsableSpace = Math.max(bFileStore.usableSpace - bFileStore.totalSpace / 20, 0L);
337+
} while (aUsableSpace == bUsableSpace); // they must be different in order to distinguish the available disk space updates
338+
long finalBUsableSpace = bUsableSpace;
339+
long finalAUsableSpace = aUsableSpace;
331340
boolean aErrorsFirst = randomBoolean();
332341
if (aErrorsFirst) {
333342
// the "a" file system will error when collecting stats
@@ -355,18 +364,10 @@ public void testAvailableDiskSpaceMonitorWhenFileSystemStatErrors() throws Excep
355364
assertThat(availableDiskSpaceUpdates.size(), is(1));
356365
if (aErrorsFirst) {
357366
// uses the stats from "b"
358-
assertThat(
359-
availableDiskSpaceUpdates.getLast().getBytes(),
360-
// the default 5% (same as flood stage level)
361-
is(Math.max(bFileStore.usableSpace - bFileStore.totalSpace / 20, 0L))
362-
);
367+
assertThat(availableDiskSpaceUpdates.getLast().getBytes(), is(finalBUsableSpace));
363368
} else {
364369
// uses the stats from "a"
365-
assertThat(
366-
availableDiskSpaceUpdates.getLast().getBytes(),
367-
// the default 5% (same as flood stage level)
368-
is(Math.max(aFileStore.usableSpace - aFileStore.totalSpace / 20, 0L))
369-
);
370+
assertThat(availableDiskSpaceUpdates.getLast().getBytes(), is(finalAUsableSpace));
370371
}
371372
}
372373
});
@@ -393,21 +394,14 @@ public void testAvailableDiskSpaceMonitorWhenFileSystemStatErrors() throws Excep
393394
}
394395
assertBusy(() -> {
395396
synchronized (availableDiskSpaceUpdates) {
397+
// the updates are different values
396398
assertThat(availableDiskSpaceUpdates.size(), is(3));
397399
if (aErrorsFirst) {
398400
// uses the stats from "a"
399-
assertThat(
400-
availableDiskSpaceUpdates.getLast().getBytes(),
401-
// the default 5% (same as flood stage level)
402-
is(Math.max(aFileStore.usableSpace - aFileStore.totalSpace / 20, 0L))
403-
);
401+
assertThat(availableDiskSpaceUpdates.getLast().getBytes(), is(finalAUsableSpace));
404402
} else {
405403
// uses the stats from "b"
406-
assertThat(
407-
availableDiskSpaceUpdates.getLast().getBytes(),
408-
// the default 5% (same as flood stage level)
409-
is(Math.max(bFileStore.usableSpace - bFileStore.totalSpace / 20, 0L))
410-
);
404+
assertThat(availableDiskSpaceUpdates.getLast().getBytes(), is(finalBUsableSpace));
411405
}
412406
}
413407
});

x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/AutoscalingStorageIntegTestCase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
1515
import org.elasticsearch.common.settings.Settings;
1616
import org.elasticsearch.datastreams.DataStreamsPlugin;
17+
import org.elasticsearch.index.engine.ThreadPoolMergeExecutorService;
1718
import org.elasticsearch.plugins.Plugin;
1819
import org.elasticsearch.xpack.autoscaling.LocalStateAutoscaling;
1920
import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction;
@@ -39,7 +40,10 @@ protected Settings nodeSettings(final int nodeOrdinal, final Settings otherSetti
3940
builder.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), LOW_WATERMARK_BYTES + "b")
4041
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), HIGH_WATERMARK_BYTES + "b")
4142
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey(), "0b")
42-
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING.getKey(), "0ms");
43+
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING.getKey(), "0ms")
44+
// the periodicity for the checker for the available disk space as well as the merge tasks' aborting status
45+
// the default of 5 seconds might timeout some tests
46+
.put(ThreadPoolMergeExecutorService.INDICES_MERGE_DISK_CHECK_INTERVAL_SETTING.getKey(), "100ms");
4347
return builder.build();
4448
}
4549

0 commit comments

Comments
 (0)