Skip to content

Commit f470511

Browse files
committed
Merge branch 'master' into 2021-11-10-jna-5.10
2 parents e6715f9 + 45b4a86 commit f470511

File tree

32 files changed

+238
-118
lines changed

32 files changed

+238
-118
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ BWC_VERSION:
4444
- "7.15.0"
4545
- "7.15.1"
4646
- "7.15.2"
47+
- "7.15.3"
4748
- "7.16.0"
4849
- "8.0.0"
4950
- "8.1.0"

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelConfig.java

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public class TrainedModelConfig implements ToXContentObject {
4545
public static final ParseField TAGS = new ParseField("tags");
4646
public static final ParseField METADATA = new ParseField("metadata");
4747
public static final ParseField INPUT = new ParseField("input");
48+
@Deprecated
4849
public static final ParseField ESTIMATED_HEAP_MEMORY_USAGE_BYTES = new ParseField("estimated_heap_memory_usage_bytes");
50+
public static final ParseField MODEL_SIZE_BYTES = new ParseField("model_size_bytes", "estimated_heap_memory_usage_bytes");
4951
public static final ParseField ESTIMATED_OPERATIONS = new ParseField("estimated_operations");
5052
public static final ParseField LICENSE_LEVEL = new ParseField("license_level");
5153
public static final ParseField DEFAULT_FIELD_MAP = new ParseField("default_field_map");
@@ -70,7 +72,7 @@ public class TrainedModelConfig implements ToXContentObject {
7072
PARSER.declareStringArray(TrainedModelConfig.Builder::setTags, TAGS);
7173
PARSER.declareObject(TrainedModelConfig.Builder::setMetadata, (p, c) -> p.map(), METADATA);
7274
PARSER.declareObject(TrainedModelConfig.Builder::setInput, (p, c) -> TrainedModelInput.fromXContent(p), INPUT);
73-
PARSER.declareLong(TrainedModelConfig.Builder::setEstimatedHeapMemory, ESTIMATED_HEAP_MEMORY_USAGE_BYTES);
75+
PARSER.declareLong(TrainedModelConfig.Builder::setModelSize, MODEL_SIZE_BYTES);
7476
PARSER.declareLong(TrainedModelConfig.Builder::setEstimatedOperations, ESTIMATED_OPERATIONS);
7577
PARSER.declareString(TrainedModelConfig.Builder::setLicenseLevel, LICENSE_LEVEL);
7678
PARSER.declareObject(TrainedModelConfig.Builder::setDefaultFieldMap, (p, c) -> p.mapStrings(), DEFAULT_FIELD_MAP);
@@ -101,7 +103,7 @@ public static TrainedModelConfig fromXContent(XContentParser parser) throws IOEx
101103
private final List<String> tags;
102104
private final Map<String, Object> metadata;
103105
private final TrainedModelInput input;
104-
private final Long estimatedHeapMemory;
106+
private final Long modelSize;
105107
private final Long estimatedOperations;
106108
private final String licenseLevel;
107109
private final Map<String, String> defaultFieldMap;
@@ -120,7 +122,7 @@ public static TrainedModelConfig fromXContent(XContentParser parser) throws IOEx
120122
List<String> tags,
121123
Map<String, Object> metadata,
122124
TrainedModelInput input,
123-
Long estimatedHeapMemory,
125+
Long modelSize,
124126
Long estimatedOperations,
125127
String licenseLevel,
126128
Map<String, String> defaultFieldMap,
@@ -138,7 +140,7 @@ public static TrainedModelConfig fromXContent(XContentParser parser) throws IOEx
138140
this.tags = tags == null ? null : Collections.unmodifiableList(tags);
139141
this.metadata = metadata == null ? null : Collections.unmodifiableMap(metadata);
140142
this.input = input;
141-
this.estimatedHeapMemory = estimatedHeapMemory;
143+
this.modelSize = modelSize;
142144
this.estimatedOperations = estimatedOperations;
143145
this.licenseLevel = licenseLevel;
144146
this.defaultFieldMap = defaultFieldMap == null ? null : Collections.unmodifiableMap(defaultFieldMap);
@@ -195,16 +197,36 @@ public TrainedModelInput getInput() {
195197
return input;
196198
}
197199

200+
/**
201+
* @deprecated use {@link TrainedModelConfig#getModelSize()} instead
202+
* @return the {@link ByteSizeValue} of the model size if available.
203+
*/
204+
@Deprecated
198205
public ByteSizeValue getEstimatedHeapMemory() {
199-
return estimatedHeapMemory == null ? null : new ByteSizeValue(estimatedHeapMemory);
206+
return modelSize == null ? null : new ByteSizeValue(modelSize);
200207
}
201208

209+
/**
210+
* @deprecated use {@link TrainedModelConfig#getModelSizeBytes()} instead
211+
* @return the model size in bytes if available.
212+
*/
213+
@Deprecated
202214
public Long getEstimatedHeapMemoryBytes() {
203-
return estimatedHeapMemory;
215+
return modelSize;
204216
}
205217

206-
public Long getEstimatedOperations() {
207-
return estimatedOperations;
218+
/**
219+
* @return the {@link ByteSizeValue} of the model size if available.
220+
*/
221+
public ByteSizeValue getModelSize() {
222+
return modelSize == null ? null : new ByteSizeValue(modelSize);
223+
}
224+
225+
/**
226+
* @return the model size in bytes if available.
227+
*/
228+
public Long getModelSizeBytes() {
229+
return modelSize;
208230
}
209231

210232
public String getLicenseLevel() {
@@ -256,8 +278,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
256278
if (input != null) {
257279
builder.field(INPUT.getPreferredName(), input);
258280
}
259-
if (estimatedHeapMemory != null) {
260-
builder.field(ESTIMATED_HEAP_MEMORY_USAGE_BYTES.getPreferredName(), estimatedHeapMemory);
281+
if (modelSize != null) {
282+
builder.field(MODEL_SIZE_BYTES.getPreferredName(), modelSize);
261283
}
262284
if (estimatedOperations != null) {
263285
builder.field(ESTIMATED_OPERATIONS.getPreferredName(), estimatedOperations);
@@ -301,7 +323,7 @@ public boolean equals(Object o) {
301323
&& Objects.equals(compressedDefinition, that.compressedDefinition)
302324
&& Objects.equals(tags, that.tags)
303325
&& Objects.equals(input, that.input)
304-
&& Objects.equals(estimatedHeapMemory, that.estimatedHeapMemory)
326+
&& Objects.equals(modelSize, that.modelSize)
305327
&& Objects.equals(estimatedOperations, that.estimatedOperations)
306328
&& Objects.equals(licenseLevel, that.licenseLevel)
307329
&& Objects.equals(defaultFieldMap, that.defaultFieldMap)
@@ -322,7 +344,7 @@ public int hashCode() {
322344
compressedDefinition,
323345
description,
324346
tags,
325-
estimatedHeapMemory,
347+
modelSize,
326348
estimatedOperations,
327349
metadata,
328350
licenseLevel,
@@ -346,7 +368,7 @@ public static class Builder {
346368
private TrainedModelDefinition definition;
347369
private String compressedDefinition;
348370
private TrainedModelInput input;
349-
private Long estimatedHeapMemory;
371+
private Long modelSize;
350372
private Long estimatedOperations;
351373
private String licenseLevel;
352374
private Map<String, String> defaultFieldMap;
@@ -431,8 +453,8 @@ public Builder setInput(TrainedModelInput input) {
431453
return this;
432454
}
433455

434-
private Builder setEstimatedHeapMemory(Long estimatedHeapMemory) {
435-
this.estimatedHeapMemory = estimatedHeapMemory;
456+
private Builder setModelSize(Long modelSize) {
457+
this.modelSize = modelSize;
436458
return this;
437459
}
438460

@@ -469,7 +491,7 @@ public TrainedModelConfig build() {
469491
tags,
470492
metadata,
471493
input,
472-
estimatedHeapMemory,
494+
modelSize,
473495
estimatedOperations,
474496
licenseLevel,
475497
defaultFieldMap,

docs/reference/how-to/fix-common-cluster-issues.asciidoc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,3 +671,70 @@ CPU usage or high JVM memory pressure. For tips, see <<high-cpu-usage>> and
671671

672672
If you regularly trigger circuit breaker errors, see <<circuit-breaker-errors>>
673673
for tips on diagnosing and preventing them.
674+
675+
[discrete]
676+
[[task-queue-backlog]]
677+
=== Task queue backlog
678+
679+
A backlogged task queue can prevent tasks from completing and
680+
put the cluster into an unhealthy state.
681+
Resource constraints, a large number of tasks being triggered at once,
682+
and long running tasks can all contribute to a backlogged task queue.
683+
684+
[discrete]
685+
[[diagnose-task-queue-backlog]]
686+
==== Diagnose a task queue backlog
687+
688+
**Check the thread pool status**
689+
690+
A <<high-cpu-usage,depleted thread pool>> can result in <<rejected-requests,rejected requests>>.
691+
692+
You can use the <<cat-thread-pool,cat thread pool API>> to
693+
see the number of active threads in each thread pool and
694+
how many tasks are queued, how many have been rejected, and how many have completed.
695+
696+
[source,console]
697+
---
698+
GET /_cat/thread_pool?v&s=t,n&h=type,name,node_name,active,queue,rejected,completed
699+
---
700+
701+
**Inspect the hot threads on each node**
702+
703+
If a particular thread pool queue is backed up,
704+
you can periodically poll the <<cluster-nodes-hot-threads,Nodes hot threads>> API
705+
to determine if the thread has sufficient
706+
resources to progress and gauge how quickly it is progressing.
707+
708+
[source,console]
709+
---
710+
GET /_nodes/hot_threads
711+
---
712+
713+
**Look for long running tasks**
714+
715+
Long-running tasks can also cause a backlog.
716+
You can use the <<tasks,task management>> API to get information about the tasks that are running.
717+
Check the `running_time_in_nanos` to identify tasks that are taking an excessive amount of time to complete.
718+
719+
[source,console]
720+
----
721+
GET /_tasks?filter_path=nodes.*.tasks
722+
----
723+
724+
[discrete]
725+
[[resolve-task-queue-backlog]]
726+
==== Resolve a task queue backlog
727+
728+
**Increase available resources**
729+
730+
If tasks are progressing slowly and the queue is backing up,
731+
you might need to take steps to <<reduce-cpu-usage>>.
732+
733+
In some cases, increasing the thread pool size might help.
734+
For example, the `force_merge` thread pool defaults to a single thread.
735+
Increasing the size to 2 might help reduce a backlog of force merge requests.
736+
737+
**Cancel stuck tasks**
738+
739+
If you find the active task's hot thread isn't progressing and there's a backlog,
740+
consider canceling the task.

docs/reference/ilm/actions/ilm-forcemerge.asciidoc

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,36 @@ Phases allowed: hot, warm.
66

77
<<indices-forcemerge,Force merges>> the index into
88
the specified maximum number of <<indices-segments,segments>>.
9-
109
This action makes the index <<dynamic-index-settings,read-only>>.
1110

12-
To use the `forcemerge` action in the `hot` phase, the `rollover` action *must* be present.
13-
If no rollover action is configured, {ilm-init} will reject the policy.
14-
1511
[NOTE]
1612
The `forcemerge` action is best effort. It might happen that some of the
1713
shards are relocating, in which case they will not be merged.
1814

15+
To use the `forcemerge` action in the `hot` phase, the `rollover` action *must* be present.
16+
If no rollover action is configured, {ilm-init} will reject the policy.
17+
18+
[[ilm-forcemerge-performance]]
19+
.Performance considerations
20+
****
21+
Force merge is a resource-intensive operation.
22+
If too many force merges are triggered at once, it can negatively impact your cluster.
23+
This can happen when you apply an {ilm-init} policy that includes a force merge action
24+
to existing indices.
25+
If they meet the `min_age` criteria, they can immediately proceed through multiple phases.
26+
You can prevent this by increasing the `min_age` or setting `index.lifecycle.origination_date`
27+
to change how the index age is calculated.
28+
29+
If you experience a force merge task queue backlog,
30+
you might need to increase the size of the force merge threadpool so
31+
indices can be force merged in parallel.
32+
To do this, configure the `thread_pool.force_merge.size` <<cluster-get-settings,cluster setting>>.
33+
34+
IMPORTANT: This can have cascading performance impacts.
35+
Monitor cluster performance and increment the size of the thread pool slowly to reduce the backlog.
36+
****
37+
38+
1939
[[ilm-forcemerge-options]]
2040
==== Options
2141

docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ The time when the trained model was created.
109109
110110
`default_field_map` :::
111111
(object)
112-
A string object that contains the default field map to use when inferring
113-
against the model. For example, {dfanalytics} may train the model on a specific
114-
multi-field `foo.keyword`. The analytics job would then supply a default field
112+
A string object that contains the default field map to use when inferring
113+
against the model. For example, {dfanalytics} may train the model on a specific
114+
multi-field `foo.keyword`. The analytics job would then supply a default field
115115
map entry for `"foo" : "foo.keyword"`.
116116
+
117117
Any field map described in the inference configuration takes precedence.
@@ -120,9 +120,9 @@ Any field map described in the inference configuration takes precedence.
120120
(string)
121121
The free-text description of the trained model.
122122
123-
`estimated_heap_memory_usage_bytes`:::
123+
`model_size_bytes`:::
124124
(integer)
125-
The estimated heap usage in bytes to keep the trained model in memory.
125+
The estimated model size in bytes to keep the trained model in memory.
126126
127127
`estimated_operations`:::
128128
(integer)
@@ -131,7 +131,7 @@ The estimated number of operations to use the trained model.
131131
`inference_config`:::
132132
(object)
133133
The default configuration for inference. This can be either a `regression`
134-
or `classification` configuration. It must match the `target_type` of the
134+
or `classification` configuration. It must match the `target_type` of the
135135
underlying `definition.trained_model`.
136136
+
137137
.Properties of `inference_config`

docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id]
4848
(Optional, boolean)
4949
If set to `true` and a `compressed_definition` is provided, the request defers
5050
definition decompression and skips relevant validations.
51-
This deferral is useful for systems or users that know a good JVM heap size estimate for their
51+
This deferral is useful for systems or users that know a good byte size estimate for their
5252
model and know that their model is valid and likely won't fail during inference.
5353

5454

@@ -373,10 +373,7 @@ An array of `trained_model` objects. Supported trained models are `tree` and
373373
A human-readable description of the {infer} trained model.
374374

375375
`estimated_heap_memory_usage_bytes`::
376-
(Optional, integer)
377-
The estimated heap usage in bytes to keep the trained model in memory. This
378-
property is supported only if `defer_definition_decompression` is `true` or the
379-
model definition is not supplied.
376+
(Optional, integer) deprecated:[7.16.0,Replaced by `model_size_bytes`]
380377

381378
`estimated_operations`::
382379
(Optional, integer)
@@ -743,6 +740,12 @@ empty as the index for storing model definitions is configured automatically.
743740
(Optional, object)
744741
An object map that contains metadata about the model.
745742

743+
`model_size_bytes`::
744+
(Optional, integer)
745+
The estimated memory usage in bytes to keep the trained model in memory. This
746+
property is supported only if `defer_definition_decompression` is `true` or the
747+
model definition is not supplied.
748+
746749
`model_type`::
747750
(Optional, string)
748751
The created model type. By default the model type is `tree_ensemble`.

docs/reference/rest-api/usage.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ GET /_xpack/usage
161161
"prepackaged": 1,
162162
"other": 0
163163
},
164-
"estimated_heap_memory_usage_bytes": {
164+
"model_size_bytes": {
165165
"min": 0.0,
166166
"max": 0.0,
167167
"avg": 0.0,

rest-api-spec/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task ->
8282
task.skipTest("search.aggregation/20_terms/string profiler via map", "The profiler results aren't backwards compatible.")
8383
task.skipTest("search.aggregation/20_terms/numeric profiler", "The profiler results aren't backwards compatible.")
8484
task.skipTest("migration/10_get_feature_upgrade_status/Get feature upgrade status", "Awaits backport")
85-
task.skipTest("cluster.put_settings/10_basic/Test put and reset transient settings", "Awaits backport")
8685

8786
task.replaceValueInMatch("_type", "_doc")
8887
task.addAllowedWarningRegex("\\[types removal\\].*")

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
---
22
"Test put and reset transient settings":
3-
- skip:
4-
version: " - 7.99.99"
5-
reason: "transient settings deprecation"
6-
features: "allowed_warnings"
7-
83
- do:
9-
allowed_warnings:
10-
- "[transient settings removal] Updating cluster settings through transientSettings is deprecated. Use persistent settings instead."
114
cluster.put_settings:
125
body:
136
transient:
@@ -23,8 +16,6 @@
2316
- match: {transient: {cluster.routing.allocation.enable: "none"}}
2417

2518
- do:
26-
allowed_warnings:
27-
- "[transient settings removal] Updating cluster settings through transientSettings is deprecated. Use persistent settings instead."
2819
cluster.put_settings:
2920
body:
3021
transient:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
9191
public static final Version V_7_15_0 = new Version(7150099, org.apache.lucene.util.Version.LUCENE_8_9_0);
9292
public static final Version V_7_15_1 = new Version(7150199, org.apache.lucene.util.Version.LUCENE_8_9_0);
9393
public static final Version V_7_15_2 = new Version(7150299, org.apache.lucene.util.Version.LUCENE_8_9_0);
94+
public static final Version V_7_15_3 = new Version(7150399, org.apache.lucene.util.Version.LUCENE_8_9_0);
9495
public static final Version V_7_16_0 = new Version(7160099, org.apache.lucene.util.Version.LUCENE_8_10_1);
9596
public static final Version V_8_0_0 = new Version(8000099, org.apache.lucene.util.Version.LUCENE_9_0_0);
9697
public static final Version V_8_1_0 = new Version(8010099, org.apache.lucene.util.Version.LUCENE_9_0_0);

x-pack/plugin/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ tasks.named("yamlRestTestV7CompatTransform").configure{ task ->
113113
task.skipTest("indices.freeze/20_stats/Translog stats on frozen indices", "#70192 -- the freeze index API is removed from 8.0")
114114
task.skipTest("indices.freeze/10_basic/Basic", "#70192 -- the freeze index API is removed from 8.0")
115115
task.skipTest("indices.freeze/10_basic/Test index options", "#70192 -- the freeze index API is removed from 8.0")
116-
task.skipTest("ml/categorization_agg/Test categorization aggregation with poor settings", "https://github.com/elastic/elasticsearch/pull/79586")
117116

118117
task.replaceValueInMatch("_type", "_doc")
119118
task.addAllowedWarningRegex("\\[types removal\\].*")

0 commit comments

Comments
 (0)