Skip to content

Commit 2da39f9

Browse files
authored
failure store backport (#132769)
1 parent fd12dcf commit 2da39f9

12 files changed

+2257
-0
lines changed

docs/build.gradle

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,101 @@ setups['setup-snapshots'] = setups['setup-repository'] + '''
20132013
refresh: true
20142014
body: |'''
20152015

2016+
buildRestTests.setups['failure-store-recipes-1'] = '''
2017+
- do:
2018+
ingest.put_pipeline:
2019+
id: ingest-step-1
2020+
body: >
2021+
{
2022+
"processors": [
2023+
{
2024+
"remove": {
2025+
"field": "important.info"
2026+
}
2027+
},
2028+
{
2029+
"pipeline": {
2030+
"name": "ingest-step-2"
2031+
}
2032+
}
2033+
]
2034+
}
2035+
2036+
- do:
2037+
ingest.put_pipeline:
2038+
id: ingest-step-2
2039+
body: >
2040+
{
2041+
"processors": [
2042+
{
2043+
"set": {
2044+
"field": "copy.info",
2045+
"copy_from": "important.info"
2046+
}
2047+
}
2048+
]
2049+
}
2050+
2051+
- do:
2052+
indices.put_index_template:
2053+
name: my-datastream-ingest-template
2054+
body:
2055+
index_patterns: my-datastream-ingest
2056+
data_stream: {}
2057+
template:
2058+
settings:
2059+
number_of_shards: 1
2060+
number_of_replicas: 0
2061+
index:
2062+
default_pipeline: "ingest-step-1"
2063+
data_stream_options:
2064+
failure_store:
2065+
enabled: true'''
2066+
2067+
buildRestTests.teardowns['failure-store-recipes-1-td'] = '''
2068+
- do:
2069+
indices.delete_data_stream:
2070+
name: my-datastream-ingest
2071+
2072+
- do:
2073+
indices.delete_index_template:
2074+
name: my-datastream-ingest-template
2075+
2076+
- do:
2077+
ingest.delete_pipeline:
2078+
id: ingest-step-1
2079+
2080+
- do:
2081+
ingest.delete_pipeline:
2082+
id: ingest-step-2
2083+
'''
2084+
2085+
buildRestTests.setups['failure-store-recipes-2'] = '''
2086+
- do:
2087+
indices.put_index_template:
2088+
name: my-datastream-ingest-template
2089+
body:
2090+
index_patterns: my-datastream-ingest
2091+
data_stream: {}
2092+
template:
2093+
settings:
2094+
number_of_shards: 1
2095+
number_of_replicas: 0
2096+
index:
2097+
default_pipeline: "complicated-processor"
2098+
data_stream_options:
2099+
failure_store:
2100+
enabled: true'''
2101+
2102+
buildRestTests.teardowns['failure-store-recipes-2-td'] = '''
2103+
- do:
2104+
indices.delete_data_stream:
2105+
name: my-datastream-ingest
2106+
2107+
- do:
2108+
indices.delete_index_template:
2109+
name: my-datastream-ingest-template
2110+
'''
20162111

20172112
for (int i = 100; i < 200; i++) {
20182113
def value = i

docs/reference/api-conventions.asciidoc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,48 @@ GET _cluster/state/metadata?filter_path=metadata.indices.*.system
264264
WARNING: When overwriting current cluster state, system indices should be restored
265265
as part of their {ref}/snapshot-restore.html#feature-state[feature state].
266266

267+
[discrete]
268+
[[node-spec-convention]]
269+
==== Node specification
270+
271+
Some cluster-level APIs may operate on a subset of the nodes which can be specified with node filters. For example, task management, node stats, and node info APIs can all report results from a filtered set of nodes rather than from all nodes. <<cluster-nodes,Learn more>>.
272+
273+
[discrete]
274+
[[component-selectors]]
275+
==== Component selectors
276+
277+
A data stream component is a logical grouping of indices that help organize data inside a data stream. All data streams contain a `data` component by default. The `data` component comprises the data stream's backing indices. When searching, managing, or indexing into a data stream, the data component is what you are interacting with by default.
278+
279+
Some data stream features are exposed as additional components alongside its `data` component. These other components are comprised of separate sets of backing indices. These additional components store supplemental data independent of the data stream's regular backing indices. An example of another component is the `failures` component exposed by the data stream <<failure-store, failure store>> feature, which captures documents that fail to be ingested in a separate set of backing indices on the data stream.
280+
281+
Some APIs that accept a `<data-stream>`, `<index>`, or `<target>` request path parameter also support selector syntax which defines which component on a data stream the API should operate on. To use a selector, it is appended to the index or data stream name. Selectors can be combined with other index pattern syntax like <<api-date-math-index-names,date math>> and wildcards.
282+
283+
There are two selector suffixes supported by Elasticsearch APIs:
284+
285+
`::data`::
286+
Refers to a data stream's backing indices containing regular data. Data streams always contain a data component.
287+
`::failures`::
288+
This component refers to the internal indices used for a data stream's <<failure-store, failure store>>.
289+
290+
As an example, <<search>>, <<search-field-caps,field capabilities>>, and <<indices-stats,index stats>> APIs can all report results from a different component rather than from the default data.
291+
292+
[source,console]
293+
----
294+
# Search a data stream normally
295+
GET my-data-stream/_search
296+
297+
# Search a data stream's failure data if present
298+
GET my-data-stream::failures/_search
299+
300+
# Syntax can be combined with other index pattern syntax (wildcards, multi-target, date math, cross cluster search, etc)
301+
GET logs-*::failures/_search
302+
GET logs-*::data,logs-*::failures/_count
303+
GET remote-cluster:logs-*-*::failures/_search
304+
GET *::data,*::failures,-logs-rdbms-*::failures/_stats
305+
GET <logs-{now/d}>::failures/_search
306+
----
307+
// TEST[skip:backport]
308+
267309
[discrete]
268310
[[api-conventions-parameters]]
269311
=== Parameters

docs/reference/data-streams/data-streams.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,4 @@ include::change-mappings-and-settings.asciidoc[]
159159
include::tsds.asciidoc[]
160160
include::logs.asciidoc[]
161161
include::lifecycle/index.asciidoc[]
162+
include::failure-store.asciidoc[]

0 commit comments

Comments
 (0)