Skip to content

Commit 9db655c

Browse files
committed
Merge branch 'main' into hnsw-directio-bfloat16-enabled
2 parents ee46e00 + bcb861a commit 9db655c

File tree

76 files changed

+2538
-478
lines changed

Some content is hidden

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

76 files changed

+2538
-478
lines changed

docs/changelog/136065.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 136065
2+
summary: Nightly maintenance for anomaly detection results indices to keep to manageable size.
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/136889.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 136889
2+
summary: Remove early phase failure in batched
3+
area: Search
4+
type: bug
5+
issues:
6+
- 134151

docs/changelog/137530.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137530
2+
summary: Allows field caps to be cross project
3+
area: Search
4+
type: enhancement
5+
issues: []

docs/reference/elasticsearch/configuration-reference/machine-learning-settings.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ $$$xpack.ml.max_open_jobs$$$
8686
`xpack.ml.nightly_maintenance_requests_per_second`
8787
: ([Dynamic](docs-content://deploy-manage/stack-settings.md#dynamic-cluster-setting)) The rate at which the nightly maintenance task deletes expired model snapshots and results. The setting is a proxy to the [`requests_per_second`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query) parameter used in the delete by query requests and controls throttling. When the {{operator-feature}} is enabled, this setting can be updated only by operator users. Valid values must be greater than `0.0` or equal to `-1.0`, where `-1.0` means a default value is used. Defaults to `-1.0`
8888

89+
`xpack.ml.results_index_rollover_max_size`
90+
: ([Dynamic](docs-content://deploy-manage/stack-settings.md#dynamic-cluster-setting)) The maximum size the anomaly detection results indices can reach before being rolled over by the nightly maintenance task. When the {{operator-feature}} is enabled, this setting can be updated only by operator users. Valid values must be greater than or equal to `-1B`. A value of `-1B` means the indices will never be rolled over. A value of `0B` means the indices will always be rolled over, regardless of size. Defaults to `50GB`.
91+
8992
`xpack.ml.node_concurrent_job_allocations`
9093
: ([Dynamic](docs-content://deploy-manage/stack-settings.md#dynamic-cluster-setting)) The maximum number of jobs that can concurrently be in the `opening` state on each node. Typically, jobs spend a small amount of time in this state before they move to `open` state. Jobs that must restore large models when they are opening spend more time in the `opening` state. When the {{operator-feature}} is enabled, this setting can be updated only by operator users. Defaults to `2`.
9194

modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportGetDataStreamsAction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ static IndexMode resolveMode(
224224
indexMode = Enum.valueOf(IndexMode.class, rawMode.toUpperCase(Locale.ROOT));
225225
}
226226
}
227+
if (indexMode == null) {
228+
String rawMode = settings.get(IndexSettings.MODE.getKey());
229+
if (rawMode != null) {
230+
indexMode = Enum.valueOf(IndexMode.class, rawMode.toUpperCase(Locale.ROOT));
231+
}
232+
}
227233
return indexMode;
228234
}
229235

modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/210_conditional_processor.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,44 @@ teardown:
221221
index: test
222222
id: "2"
223223
catch: missing
224+
225+
---
226+
"Test conditionals support params and statements":
227+
- do:
228+
ingest.put_pipeline:
229+
id: "my_pipeline"
230+
body: >
231+
{
232+
"description": "_description",
233+
"processors": [
234+
{
235+
"set" : {
236+
"if" : {
237+
"source": "def hit = params.success_codes.containsKey(ctx.code); return hit != null && hit == true;",
238+
"params": {
239+
"success_codes" : {
240+
"10": true,
241+
"20": true
242+
}
243+
}
244+
},
245+
"field" : "result",
246+
"value" : "success"
247+
}
248+
}
249+
]
250+
}
251+
- match: { acknowledged: true }
252+
253+
- do:
254+
index:
255+
index: test
256+
id: "1"
257+
pipeline: "my_pipeline"
258+
body: { code: "20" }
259+
260+
- do:
261+
get:
262+
index: test
263+
id: "1"
264+
- match: { _source.result: "success" }

modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ public void testInvalidTimestamp() throws Exception {
163163

164164
putGeoIpPipeline();
165165
verifyUpdatedDatabase();
166+
awaitAllNodesDownloadedDatabases();
166167

167168
updateClusterSettings(Settings.builder().put("ingest.geoip.database_validity", TimeValue.timeValueMillis(1)));
168169
updateClusterSettings(
@@ -215,6 +216,7 @@ public void testInvalidTimestamp() throws Exception {
215216
}
216217
}
217218
});
219+
awaitAllNodesDownloadedDatabases();
218220
}
219221

220222
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/92888")
@@ -305,6 +307,7 @@ public void testGeoIpDatabasesDownloadNoGeoipProcessors() throws Exception {
305307
assertNotNull(task);
306308
assertNotNull(task.getState());
307309
});
310+
awaitAllNodesDownloadedDatabases();
308311
putNonGeoipPipeline(pipelineId);
309312
assertNotNull(getTask().getState()); // removing all geoip processors should not result in the task being stopped
310313
assertBusy(() -> {
@@ -350,6 +353,7 @@ public void testDoNotDownloadDatabaseOnPipelineCreation() throws Exception {
350353
containsInAnyOrder("GeoLite2-ASN.mmdb", "GeoLite2-City.mmdb", "GeoLite2-Country.mmdb", "MyCustomGeoLite2-City.mmdb")
351354
);
352355
}, 2, TimeUnit.MINUTES);
356+
awaitAllNodesDownloadedDatabases();
353357

354358
// Remove the created index.
355359
assertAcked(indicesAdmin().prepareDelete(indexIdentifier).get());
@@ -411,6 +415,7 @@ public void testUseGeoIpProcessorWithDownloadedDBs() throws Exception {
411415
}, 20, TimeUnit.SECONDS);
412416

413417
verifyUpdatedDatabase();
418+
awaitAllNodesDownloadedDatabases();
414419

415420
// Disable downloader:
416421
updateClusterSettings(Settings.builder().put(GeoIpDownloaderTaskExecutor.ENABLED_SETTING.getKey(), false));
@@ -453,6 +458,7 @@ public void testStartWithNoDatabases() throws Exception {
453458
// Enable downloader:
454459
updateClusterSettings(Settings.builder().put(GeoIpDownloaderTaskExecutor.ENABLED_SETTING.getKey(), true));
455460
verifyUpdatedDatabase();
461+
awaitAllNodesDownloadedDatabases();
456462
}
457463

458464
private void verifyUpdatedDatabase() throws Exception {
@@ -473,6 +479,27 @@ private void verifyUpdatedDatabase() throws Exception {
473479
});
474480
}
475481

482+
/**
483+
* Waits until all ingest nodes report having downloaded the expected databases. This ensures that all ingest nodes are in a consistent
484+
* state and prevents us from deleting databases before they've been downloaded on all nodes.
485+
*/
486+
private void awaitAllNodesDownloadedDatabases() throws Exception {
487+
assertBusy(() -> {
488+
GeoIpStatsAction.Response response = client().execute(GeoIpStatsAction.INSTANCE, new GeoIpStatsAction.Request()).actionGet();
489+
assertThat(response.getNodes(), not(empty()));
490+
491+
for (GeoIpStatsAction.NodeResponse nodeResponse : response.getNodes()) {
492+
if (nodeResponse.getNode().isIngestNode() == false) {
493+
continue;
494+
}
495+
assertThat(
496+
nodeResponse.getDatabases(),
497+
containsInAnyOrder("GeoLite2-Country.mmdb", "GeoLite2-City.mmdb", "GeoLite2-ASN.mmdb", "MyCustomGeoLite2-City.mmdb")
498+
);
499+
}
500+
});
501+
}
502+
476503
private GeoIpTaskState getGeoIpTaskState() {
477504
PersistentTasksCustomMetadata.PersistentTask<PersistentTaskParams> task = getTask();
478505
assertNotNull(task);

muted-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,6 @@ tests:
258258
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
259259
method: test {p0=mtermvectors/10_basic/Tests catching other exceptions per item}
260260
issue: https://github.com/elastic/elasticsearch/issues/122414
261-
- class: org.elasticsearch.search.SearchWithRejectionsIT
262-
method: testOpenContextsAfterRejections
263-
issue: https://github.com/elastic/elasticsearch/issues/130821
264261
- class: org.elasticsearch.packaging.test.DockerTests
265262
method: test090SecurityCliPackaging
266263
issue: https://github.com/elastic/elasticsearch/issues/131107
@@ -470,6 +467,9 @@ tests:
470467
- class: org.elasticsearch.xpack.inference.integration.CCMStorageServiceIT
471468
method: testStoreAndGetCCMModel
472469
issue: https://github.com/elastic/elasticsearch/issues/137630
470+
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeMetricsIT
471+
method: test
472+
issue: https://github.com/elastic/elasticsearch/issues/137655
473473

474474
# Examples:
475475
#

server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
import org.elasticsearch.action.ActionRequestValidationException;
1515
import org.elasticsearch.action.IndicesRequest;
1616
import org.elasticsearch.action.LegacyActionRequest;
17+
import org.elasticsearch.action.ResolvedIndexExpressions;
1718
import org.elasticsearch.action.ValidateActions;
1819
import org.elasticsearch.action.support.IndicesOptions;
1920
import org.elasticsearch.common.Strings;
2021
import org.elasticsearch.common.io.stream.StreamInput;
2122
import org.elasticsearch.common.io.stream.StreamOutput;
23+
import org.elasticsearch.core.Nullable;
2224
import org.elasticsearch.index.query.QueryBuilder;
2325
import org.elasticsearch.tasks.CancellableTask;
2426
import org.elasticsearch.tasks.Task;
@@ -51,6 +53,8 @@ public final class FieldCapabilitiesRequest extends LegacyActionRequest implemen
5153
private String[] types = Strings.EMPTY_ARRAY;
5254
private boolean includeUnmapped = false;
5355
private boolean includeEmptyFields = true;
56+
@Nullable
57+
private ResolvedIndexExpressions resolvedIndexExpressions = null;
5458
/**
5559
* Controls whether the field caps response should always include the list of indices
5660
* where a field is defined. This flag is only used locally on the coordinating node,
@@ -60,6 +64,7 @@ public final class FieldCapabilitiesRequest extends LegacyActionRequest implemen
6064
private transient boolean includeIndices = false;
6165

6266
private boolean includeResolvedTo = false;
67+
private String projectRouting;
6368

6469
/**
6570
* Controls whether all local indices should be returned if no remotes matched
@@ -259,6 +264,31 @@ public boolean allowsRemoteIndices() {
259264
return true;
260265
}
261266

267+
@Override
268+
public boolean allowsCrossProject() {
269+
return true;
270+
}
271+
272+
@Override
273+
public void setResolvedIndexExpressions(ResolvedIndexExpressions expressions) {
274+
this.resolvedIndexExpressions = expressions;
275+
}
276+
277+
@Override
278+
@Nullable
279+
public ResolvedIndexExpressions getResolvedIndexExpressions() {
280+
return resolvedIndexExpressions;
281+
}
282+
283+
public void projectRouting(String projectRouting) {
284+
this.projectRouting = projectRouting;
285+
}
286+
287+
@Override
288+
public String getProjectRouting() {
289+
return projectRouting;
290+
}
291+
262292
@Override
263293
public boolean includeDataStreams() {
264294
return true;

server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ public Builder withResolvedRemotelyBuilder(Map<String, ResolvedIndexExpressions.
321321
return this;
322322
}
323323

324+
public Builder withResolvedRemotely(Map<String, ResolvedIndexExpressions> resolvedRemotely) {
325+
this.resolvedRemotely = resolvedRemotely;
326+
return this;
327+
}
328+
324329
public Builder withResolvedLocally(ResolvedIndexExpressions resolvedLocally) {
325330
this.resolvedLocally = resolvedLocally;
326331
return this;

0 commit comments

Comments
 (0)