Commit aa2d5dd
committed
[Failure store] Introduce dedicated failure store lifecycle configuration (elastic#127314)
The failure store is a set of data stream indices that are used to store certain type of ingestion failures. Until this moment they were sharing the configuration of the backing indices. We understand that the two data sets have different lifecycle needs.
We believe that typically the failures will need to be retained much less than the data. Considering this we believe the lifecycle needs of the failures also more limited and they fit better the simplicity of the data stream lifecycle feature.
This allows the user to only set the desired retention and we will perform the rollover and other maintenance tasks without the user having to think about them. Furthermore, having only one lifecycle management feature allows us to ensure that these data is managed by default.
This PR introduces the following:
Configuration
We extend the failure store configuration to allow lifecycle configuration too, this configuration reflects the user's configuration only as shown below:
PUT _data_stream/*/options
{
"failure_store": {
"lifecycle": {
"data_retention": "5d"
}
}
}
GET _data_stream/*/options
{
"data_streams": [
{
"name": "my-ds",
"options": {
"failure_store": {
"lifecycle": {
"data_retention": "5d"
}
}
}
}
]
}
To retrieve the effective configuration you need to use the GET data streams API, see elastic#126668
Functionality
The data stream lifecycle (DLM) will manage the failure indices regardless if the failure store is enabled or not. This will ensure that if the failure store gets disabled we will not have stagnant data.
The data stream options APIs reflect only the user's configuration.
The GET data stream API should be used to check the current state of the effective failure store configuration.
Telemetry
We extend the data stream failure store telemetry to also include the lifecycle telemetry.
{
"data_streams": {
"available": true,
"enabled": true,
"data_streams": 10,
"indices_count": 50,
"failure_store": {
"explicitly_enabled_count": 1,
"effectively_enabled_count": 15,
"failure_indices_count": 30
"lifecycle": {
"explicitly_enabled_count": 5,
"effectively_enabled_count": 20,
"data_retention": {
"configured_data_streams": 5,
"minimum_millis": X,
"maximum_millis": Y,
"average_millis": Z,
},
"effective_retention": {
"retained_data_streams": 20,
"minimum_millis": X,
"maximum_millis": Y,
"average_millis": Z
},
"global_retention": {
"max": {
"defined": false
},
"default": {
"defined": true, <------ this is the default value applicable for the failure store
"millis": X
}
}
}
}
}
Implementation details
We ensure that partially reset failure store will create valid failure store configuration.
We ensure that when a node communicates with a note with a previous version it will ensure it will not send an invalid failure store configuration enabled: null.
(cherry picked from commit 03d7781)
# Conflicts:
# modules/data-streams/src/main/java/org/elasticsearch/datastreams/DataStreamsPlugin.java
# modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleService.java
# modules/data-streams/src/test/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleServiceTests.java
# server/src/main/java/org/elasticsearch/TransportVersions.java
# server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsService.java
# server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTests.java1 parent 4d091b7 commit aa2d5dd
File tree
45 files changed
+1913
-659
lines changed- docs/changelog
- modules/data-streams
- src
- internalClusterTest/java/org/elasticsearch/datastreams/lifecycle
- javaRestTest/java/org/elasticsearch/datastreams/lifecycle
- main/java/org/elasticsearch/datastreams
- lifecycle
- options
- action
- rest
- test/java/org/elasticsearch/datastreams/lifecycle
- yamlRestTest/resources/rest-api-spec/test/data_stream
- server/src
- main/java/org/elasticsearch
- action/datastreams
- cluster/metadata
- rest/action/admin/indices
- test/java/org/elasticsearch/cluster/metadata
- test/framework/src/main/java/org/elasticsearch/cluster/metadata
- x-pack/plugin
- core/src
- internalClusterTest/java/org/elasticsearch/xpack/core/action
- main/java/org/elasticsearch/xpack/core
- action
- datastreams
- test/java/org/elasticsearch/xpack/core
- datastreams
- searchablesnapshots
- esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action
- security/src/internalClusterTest/java/org/elasticsearch/integration
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
45 files changed
+1913
-659
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
Lines changed: 34 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
1033 | | - | |
1034 | | - | |
| 1033 | + | |
1035 | 1034 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | 1035 | | |
1045 | 1036 | | |
1046 | 1037 | | |
| |||
1054 | 1045 | | |
1055 | 1046 | | |
1056 | 1047 | | |
1057 | | - | |
| 1048 | + | |
1058 | 1049 | | |
1059 | 1050 | | |
1060 | 1051 | | |
| |||
1109 | 1100 | | |
1110 | 1101 | | |
1111 | 1102 | | |
1112 | | - | |
| 1103 | + | |
1113 | 1104 | | |
1114 | 1105 | | |
1115 | 1106 | | |
| |||
1202 | 1193 | | |
1203 | 1194 | | |
1204 | 1195 | | |
1205 | | - | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1206 | 1210 | | |
1207 | 1211 | | |
1208 | 1212 | | |
| |||
1213 | 1217 | | |
1214 | 1218 | | |
1215 | 1219 | | |
1216 | | - | |
1217 | | - | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1218 | 1224 | | |
1219 | 1225 | | |
1220 | 1226 | | |
| |||
1233 | 1239 | | |
1234 | 1240 | | |
1235 | 1241 | | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1236 | 1252 | | |
1237 | 1253 | | |
1238 | 1254 | | |
| |||
Lines changed: 24 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
| 357 | + | |
| 358 | + | |
372 | 359 | | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
377 | 381 | | |
378 | 382 | | |
379 | 383 | | |
| |||
Lines changed: 80 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
46 | 61 | | |
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
50 | 65 | | |
51 | | - | |
| 66 | + | |
52 | 67 | | |
53 | 68 | | |
54 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
55 | 74 | | |
56 | 75 | | |
57 | 76 | | |
| |||
64 | 83 | | |
65 | 84 | | |
66 | 85 | | |
67 | | - | |
| 86 | + | |
68 | 87 | | |
69 | 88 | | |
70 | 89 | | |
| |||
78 | 97 | | |
79 | 98 | | |
80 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
81 | 112 | | |
82 | 113 | | |
83 | 114 | | |
| |||
92 | 123 | | |
93 | 124 | | |
94 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
95 | 130 | | |
96 | 131 | | |
97 | 132 | | |
| |||
101 | 136 | | |
102 | 137 | | |
103 | 138 | | |
| 139 | + | |
| 140 | + | |
104 | 141 | | |
105 | | - | |
| 142 | + | |
| 143 | + | |
106 | 144 | | |
107 | 145 | | |
108 | 146 | | |
| |||
123 | 161 | | |
124 | 162 | | |
125 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
126 | 168 | | |
127 | 169 | | |
128 | 170 | | |
| |||
132 | 174 | | |
133 | 175 | | |
134 | 176 | | |
| 177 | + | |
| 178 | + | |
135 | 179 | | |
136 | | - | |
| 180 | + | |
| 181 | + | |
137 | 182 | | |
138 | 183 | | |
139 | 184 | | |
| |||
157 | 202 | | |
158 | 203 | | |
159 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
160 | 223 | | |
161 | 224 | | |
162 | 225 | | |
| |||
175 | 238 | | |
176 | 239 | | |
177 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
178 | 249 | | |
179 | 250 | | |
180 | 251 | | |
| |||
184 | 255 | | |
185 | 256 | | |
186 | 257 | | |
| 258 | + | |
| 259 | + | |
187 | 260 | | |
188 | | - | |
| 261 | + | |
| 262 | + | |
189 | 263 | | |
190 | 264 | | |
191 | 265 | | |
0 commit comments