Skip to content

Commit 8b32340

Browse files
author
elasticsearchmachine
committed
Merge remote-tracking branch 'origin/main' into lucene_snapshot
2 parents 2d25cbc + 9da39f0 commit 8b32340

File tree

43 files changed

+562
-249
lines changed

Some content is hidden

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

43 files changed

+562
-249
lines changed

docs/changelog/112645.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 112645
2+
summary: Add support for multi-value dimensions
3+
area: Mapping
4+
type: enhancement
5+
issues:
6+
- 110387

docs/reference/mapping/types/keyword.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ index setting limits the number of dimensions in an index.
163163
Dimension fields have the following constraints:
164164

165165
* The `doc_values` and `index` mapping parameters must be `true`.
166-
* Field values cannot be an <<array,array or multi-value>>.
167166
// end::dimension[]
168167
* Dimension values are used to identify a document’s time series. If dimension values are altered in any way during indexing, the document will be stored as belonging to different from intended time series. As a result there are additional constraints:
169168
** The field cannot use a <<normalizer,`normalizer`>>.

docs/reference/release-notes/8.15.0.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ To work around this issue, you have a number of options:
4444
<<esql-kibana-enable,disable ES|QL queries in {kib}>>
4545
** Change the default data view in Discover to a smaller set of indices and/or one with fewer mapping conflicts.
4646

47+
* Synthetic source bug. Synthetic source may fail generating the _source at runtime, causing failures in get APIs or
48+
partial failures in the search APIs. The result is that for the affected documents the _source can't be retrieved.
49+
There is no workaround and the only option to is to upgrade to 8.15.2 when released.
50+
+
51+
If you use synthetic source then you may be affected by this bug if the following is true:
52+
** If you have more fields then the `index.mapping.total_fields.limit` setting allows.
53+
** If you use dynamic mappings and the `index.mapping.total_fields.ignore_dynamic_beyond_limit` setting is enabled.
54+
4755
[[breaking-8.15.0]]
4856
[float]
4957
=== Breaking changes

docs/reference/release-notes/8.15.1.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@ To work around this issue, you have a number of options:
2424
<<esql-kibana-enable,disable ES|QL queries in {kib}>>
2525
** Change the default data view in Discover to a smaller set of indices and/or one with fewer mapping conflicts.
2626

27-
* Index Stats, Node Stats and Cluster Stats API can return a null pointer exception if an index contains a `dense_vector` field
27+
* Index Stats, Node Stats and Cluster Stats API can return a null pointer exception if an index contains a `dense_vector` field
2828
but there is an index segment that does not contain any documents with a dense vector field ({es-pull}112720[#112720]). Workarounds:
2929
** If the affected index already contains documents with a dense vector field, force merge the index to a single segment.
3030
** If the affected index does not already contain documents with a dense vector field, index a document with a dense vector field
3131
and then force merge to a single segment.
3232
** If the affected index's `dense_vector` fields are unused, reindex without the `dense_vector` fields.
3333

34+
* Synthetic source bug. Synthetic source may fail generating the _source at runtime, causing failures in get APIs or
35+
partial failures in the search APIs. The result is that for the affected documents the _source can't be retrieved.
36+
There is no workaround and the only option to is to upgrade to 8.15.2 when released.
37+
+
38+
If you use synthetic source then you may be affected by this bug if the following is true:
39+
** If you have more fields then the `index.mapping.total_fields.limit` setting allows.
40+
** If you use dynamic mappings and the `index.mapping.total_fields.ignore_dynamic_beyond_limit` setting is enabled.
3441

3542
[[bug-8.15.1]]
3643
[float]

docs/reference/rest-api/security/get-service-accounts.asciidoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ GET /_security/service/elastic/fleet-server
250250
"monitor",
251251
"create_index",
252252
"auto_configure",
253-
"maintenance"
253+
"maintenance",
254+
"view_index_metadata"
254255
],
255256
"allow_restricted_indices": false
256257
},
@@ -265,7 +266,8 @@ GET /_security/service/elastic/fleet-server
265266
"monitor",
266267
"create_index",
267268
"auto_configure",
268-
"maintenance"
269+
"maintenance",
270+
"view_index_metadata"
269271
],
270272
"allow_restricted_indices": false
271273
}

modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,3 +1230,83 @@ non string dimension fields:
12301230
- match: { .$idx0name.mappings.properties.attributes.properties.double.time_series_dimension: true }
12311231
- match: { .$idx0name.mappings.properties.attributes.properties.host\.ip.type: 'ip' }
12321232
- match: { .$idx0name.mappings.properties.attributes.properties.host\.ip.time_series_dimension: true }
1233+
1234+
---
1235+
multi value dimensions:
1236+
- requires:
1237+
cluster_features: ["routing.multi_value_routing_path"]
1238+
reason: support for multi-value dimensions
1239+
1240+
- do:
1241+
allowed_warnings:
1242+
- "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
1243+
indices.put_index_template:
1244+
name: my-dynamic-template
1245+
body:
1246+
index_patterns: [k9s*]
1247+
data_stream: {}
1248+
template:
1249+
settings:
1250+
index:
1251+
number_of_shards: 1
1252+
mode: time_series
1253+
time_series:
1254+
start_time: 2023-08-31T13:03:08.138Z
1255+
1256+
mappings:
1257+
properties:
1258+
attributes:
1259+
type: passthrough
1260+
dynamic: true
1261+
time_series_dimension: true
1262+
priority: 1
1263+
dynamic_templates:
1264+
- counter_metric:
1265+
mapping:
1266+
type: integer
1267+
time_series_metric: counter
1268+
1269+
- do:
1270+
bulk:
1271+
index: k9s
1272+
refresh: true
1273+
body:
1274+
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
1275+
- '{ "@timestamp": "2023-09-01T13:03:08.138Z","data": "10", "attributes": { "dim1": ["a" , "b"], "dim2": [1, 2] } }'
1276+
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
1277+
- '{ "@timestamp": "2023-09-01T13:03:08.138Z","data": "20", "attributes": { "dim1": ["b" , "a"], "dim2": [1, 2] } }'
1278+
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
1279+
- '{ "@timestamp": "2023-09-01T13:03:08.138Z","data": "20", "attributes": { "dim1": ["c" , "b"], "dim2": [1, 2] } }'
1280+
- is_false: errors
1281+
1282+
- do:
1283+
search:
1284+
index: k9s
1285+
body:
1286+
size: 0
1287+
aggs:
1288+
tsids:
1289+
terms:
1290+
field: _tsid
1291+
1292+
- length: { aggregations.tsids.buckets: 3 } # only the order of the dim1 attribute is different, yet we expect to have two distinct time series
1293+
1294+
- do:
1295+
search:
1296+
index: k9s
1297+
body:
1298+
size: 0
1299+
aggs:
1300+
dims:
1301+
terms:
1302+
field: dim1
1303+
order:
1304+
_key: asc
1305+
1306+
- length: { aggregations.dims.buckets: 3 }
1307+
- match: { aggregations.dims.buckets.0.key: a }
1308+
- match: { aggregations.dims.buckets.0.doc_count: 2 }
1309+
- match: { aggregations.dims.buckets.1.key: b }
1310+
- match: { aggregations.dims.buckets.1.doc_count: 3 }
1311+
- match: { aggregations.dims.buckets.2.key: c }
1312+
- match: { aggregations.dims.buckets.2.doc_count: 1 }

muted-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ tests:
330330
- class: org.elasticsearch.integration.KibanaUserRoleIntegTests
331331
method: testSearchAndMSearch
332332
issue: https://github.com/elastic/elasticsearch/issues/113345
333+
- class: org.elasticsearch.action.bulk.IncrementalBulkIT
334+
method: testBulkLevelBulkFailureAfterFirstIncrementalRequest
335+
issue: https://github.com/elastic/elasticsearch/issues/113365
336+
- class: org.elasticsearch.xpack.ml.integration.MlJobIT
337+
method: testDeleteJob_TimingStatsDocumentIsDeleted
338+
issue: https://github.com/elastic/elasticsearch/issues/113370
333339

334340
# Examples:
335341
#

rest-api-spec/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ tasks.register('enforceYamlTestConvention').configure {
5353
tasks.named("precommit").configure {
5454
dependsOn 'enforceYamlTestConvention'
5555
}
56+
57+
tasks.named("yamlRestCompatTestTransform").configure({ task ->
58+
task.skipTest("tsdb/140_routing_path/multi-value routing path field", "Multi-value routing paths are allowed now. See #112645")
59+
})

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/140_routing_path.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ missing dimension on routing path field:
119119
type: keyword
120120

121121
---
122-
multi-value routing path field:
122+
multi-value routing path field succeeds:
123123
- requires:
124124
test_runner_features: close_to
125-
cluster_features: ["gte_v8.13.0"]
126-
reason: _tsid hashing introduced in 8.13
125+
cluster_features: ["routing.multi_value_routing_path"]
126+
reason: support for multi-value dimensions
127127

128128
- do:
129129
indices.create:
@@ -172,12 +172,7 @@ multi-value routing path field:
172172
- '{"index": {}}'
173173
- '{"@timestamp": "2021-04-28T18:35:54.467Z", "uid": "df3145b3-0563-4d3b-a0f7-897eb2876ea9", "voltage": 6.8, "unmapped_field": 40, "tag": [ "one", "three" ] }'
174174

175-
- is_true: errors
176-
177-
- match: {items.1.index.error.reason: "Error extracting routing: Routing values must be strings but found [START_ARRAY]" }
178-
- match: {items.3.index.error.reason: "Error extracting routing: Routing values must be strings but found [START_ARRAY]" }
179-
- match: {items.4.index.error.reason: "Error extracting routing: Routing values must be strings but found [START_ARRAY]" }
180-
- match: {items.7.index.error.reason: "Error extracting routing: Routing values must be strings but found [START_ARRAY]" }
175+
- is_false: errors
181176

182177
- do:
183178
search:
@@ -195,13 +190,21 @@ multi-value routing path field:
195190
avg:
196191
field: voltage
197192

198-
- match: {hits.total.value: 4}
199-
- length: {aggregations.tsids.buckets: 2}
193+
- match: {hits.total.value: 8}
194+
- length: {aggregations.tsids.buckets: 4}
200195

201-
- match: {aggregations.tsids.buckets.0.key: "KDODRmbj7vu4rLWvjrJbpUuaET_vOYoRw6ImzKEcF4sEaGKnXSaKfM0" }
196+
- match: {aggregations.tsids.buckets.0.key: "KDODRmbj7vu4rLWvjrJbpUtt0uPSOYoRw_LI4DD7DFEGEJ3NR3eQkMY" }
202197
- match: {aggregations.tsids.buckets.0.doc_count: 2 }
203198
- close_to: {aggregations.tsids.buckets.0.voltage.value: { value: 6.70, error: 0.01 }}
204199

205-
- match: { aggregations.tsids.buckets.1.key: "KDODRmbj7vu4rLWvjrJbpUvcUWJEddqA4Seo8jbBBBFxwC0lrefCb6A" }
200+
- match: { aggregations.tsids.buckets.1.key: "KDODRmbj7vu4rLWvjrJbpUtt0uPSddqA4WYKglGPR_C0cJe8QGaiC2c" }
206201
- match: {aggregations.tsids.buckets.1.doc_count: 2 }
207-
- close_to: {aggregations.tsids.buckets.1.voltage.value: { value: 7.30, error: 0.01 }}
202+
- close_to: {aggregations.tsids.buckets.1.voltage.value: { value: 7.15, error: 0.01 }}
203+
204+
- match: { aggregations.tsids.buckets.2.key: "KDODRmbj7vu4rLWvjrJbpUuaET_vOYoRw6ImzKEcF4sEaGKnXSaKfM0" }
205+
- match: {aggregations.tsids.buckets.2.doc_count: 2 }
206+
- close_to: {aggregations.tsids.buckets.2.voltage.value: { value: 6.70, error: 0.01 }}
207+
208+
- match: { aggregations.tsids.buckets.3.key: "KDODRmbj7vu4rLWvjrJbpUvcUWJEddqA4Seo8jbBBBFxwC0lrefCb6A" }
209+
- match: {aggregations.tsids.buckets.3.doc_count: 2 }
210+
- close_to: {aggregations.tsids.buckets.3.voltage.value: { value: 7.30, error: 0.01 }}

server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
1919
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotStatus;
2020
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse;
21-
import org.elasticsearch.action.admin.indices.delete.DeleteIndexClusterStateUpdateRequest;
2221
import org.elasticsearch.action.support.ActionTestUtils;
2322
import org.elasticsearch.action.support.GroupedActionListener;
2423
import org.elasticsearch.action.support.PlainActionFuture;
@@ -33,9 +32,7 @@
3332
import org.elasticsearch.common.util.concurrent.ListenableFuture;
3433
import org.elasticsearch.common.util.concurrent.UncategorizedExecutionException;
3534
import org.elasticsearch.core.PathUtils;
36-
import org.elasticsearch.core.TimeValue;
3735
import org.elasticsearch.discovery.AbstractDisruptionTestCase;
38-
import org.elasticsearch.index.Index;
3936
import org.elasticsearch.plugins.Plugin;
4037
import org.elasticsearch.repositories.IndexId;
4138
import org.elasticsearch.repositories.RepositoryConflictException;
@@ -59,6 +56,7 @@
5956
import java.util.HashMap;
6057
import java.util.List;
6158
import java.util.Map;
59+
import java.util.Set;
6260
import java.util.concurrent.ExecutionException;
6361
import java.util.concurrent.TimeUnit;
6462
import java.util.stream.Collectors;
@@ -2214,12 +2212,17 @@ public void testDeleteIndexWithOutOfOrderFinalization() {
22142212
.anyMatch(e -> e.snapshot().getSnapshotId().getName().equals("snapshot-with-index-1") && e.state().completed())
22152213
)
22162214
// execute the index deletion _directly on the master_ so it happens before the snapshot finalization executes
2217-
.andThen(l -> masterDeleteIndexService.deleteIndices(new DeleteIndexClusterStateUpdateRequest(l.map(r -> {
2218-
assertTrue(r.isAcknowledged());
2219-
return null;
2220-
})).indices(new Index[] { internalCluster().clusterService().state().metadata().index(indexToDelete).getIndex() })
2221-
.ackTimeout(TimeValue.timeValueSeconds(10))
2222-
.masterNodeTimeout(TimeValue.timeValueSeconds(10))))
2215+
.andThen(
2216+
l -> masterDeleteIndexService.deleteIndices(
2217+
TEST_REQUEST_TIMEOUT,
2218+
TEST_REQUEST_TIMEOUT,
2219+
Set.of(internalCluster().clusterService().state().metadata().index(indexToDelete).getIndex()),
2220+
l.map(r -> {
2221+
assertTrue(r.isAcknowledged());
2222+
return null;
2223+
})
2224+
)
2225+
)
22232226
// ultimately create the index again so that taking a full snapshot will pick up any missing shard gen blob, and deleting that
22242227
// full snapshot will clean up all dangling shard-level blobs
22252228
.andThen((l, ignored) -> prepareCreate(indexToDelete, indexSettingsNoReplicas(1)).execute(l.map(r -> {

0 commit comments

Comments
 (0)