Commit 7aa0daa
David Roberts
[7.x][ML] More advanced model snapshot retention options (#56194)
This PR implements the following changes to make ML model snapshot
retention more flexible in advance of adding a UI for the feature in
an upcoming release.
- The default for `model_snapshot_retention_days` for new jobs is now
10 instead of 1
- There is a new job setting, `daily_model_snapshot_retention_after_days`,
that defaults to 1 for new jobs and `model_snapshot_retention_days`
for pre-7.8 jobs
- For days that are older than `model_snapshot_retention_days`, all
model snapshots are deleted as before
- For days that are in between `daily_model_snapshot_retention_after_days`
and `model_snapshot_retention_days` all but the first model snapshot
for that day are deleted
- The `retain` setting of model snapshots is still respected to allow
selected model snapshots to be retained indefinitely
Backport of #561251 parent 4dfdd46 commit 7aa0daa
File tree
28 files changed
+593
-99
lines changed- client/rest-high-level/src/test/java/org/elasticsearch/client
- ml/job/config
- docs/reference/ml
- anomaly-detection/apis
- x-pack/plugin
- core/src
- main
- java/org/elasticsearch/xpack/core/ml/job
- config
- messages
- results
- resources/org/elasticsearch/xpack/core/ml
- test/java/org/elasticsearch/xpack/core/ml/job/config
- ml
- qa
- ml-with-security
- native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration
- src
- main/java/org/elasticsearch/xpack/ml
- action
- job
- persistence
- retention
- test/java/org/elasticsearch/xpack/ml/job/retention
- src/test/resources/rest-api-spec/test/ml
28 files changed
+593
-99
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2549 | 2549 | | |
2550 | 2550 | | |
2551 | 2551 | | |
2552 | | - | |
| 2552 | + | |
2553 | 2553 | | |
2554 | 2554 | | |
2555 | 2555 | | |
| 2556 | + | |
| 2557 | + | |
2556 | 2558 | | |
2557 | 2559 | | |
2558 | 2560 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
144 | 145 | | |
145 | | - | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
| |||
320 | 324 | | |
321 | 325 | | |
322 | 326 | | |
323 | | - | |
| 327 | + | |
| 328 | + | |
324 | 329 | | |
325 | 330 | | |
326 | 331 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
364 | 376 | | |
365 | 377 | | |
366 | 378 | | |
| |||
992 | 1004 | | |
993 | 1005 | | |
994 | 1006 | | |
995 | | - | |
996 | | - | |
| 1007 | + | |
| 1008 | + | |
997 | 1009 | | |
998 | 1010 | | |
999 | 1011 | | |
| |||
Lines changed: 39 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
858 | 859 | | |
859 | 860 | | |
860 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
861 | 866 | | |
862 | 867 | | |
863 | 868 | | |
| |||
1105 | 1110 | | |
1106 | 1111 | | |
1107 | 1112 | | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | 1113 | | |
1112 | 1114 | | |
1113 | 1115 | | |
| |||
1117 | 1119 | | |
1118 | 1120 | | |
1119 | 1121 | | |
| 1122 | + | |
| 1123 | + | |
1120 | 1124 | | |
1121 | 1125 | | |
1122 | 1126 | | |
| |||
1138 | 1142 | | |
1139 | 1143 | | |
1140 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
1141 | 1176 | | |
1142 | 1177 | | |
1143 | 1178 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
0 commit comments