Commit c99021c
David Roberts
[ML] More advanced model snapshot retention options (#56125)
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
Closes #521501 parent b82f659 commit c99021c
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 | |
|---|---|---|---|
| |||
2519 | 2519 | | |
2520 | 2520 | | |
2521 | 2521 | | |
2522 | | - | |
| 2522 | + | |
2523 | 2523 | | |
2524 | 2524 | | |
2525 | 2525 | | |
| 2526 | + | |
| 2527 | + | |
2526 | 2528 | | |
2527 | 2529 | | |
2528 | 2530 | | |
| |||
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 | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
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 | | |
| |||
997 | 1009 | | |
998 | 1010 | | |
999 | 1011 | | |
1000 | | - | |
1001 | | - | |
| 1012 | + | |
| 1013 | + | |
1002 | 1014 | | |
1003 | 1015 | | |
1004 | 1016 | | |
| |||
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 | | |
| |||
808 | 809 | | |
809 | 810 | | |
810 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
811 | 816 | | |
812 | 817 | | |
813 | 818 | | |
| |||
1043 | 1048 | | |
1044 | 1049 | | |
1045 | 1050 | | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | 1051 | | |
1050 | 1052 | | |
1051 | 1053 | | |
| |||
1055 | 1057 | | |
1056 | 1058 | | |
1057 | 1059 | | |
| 1060 | + | |
| 1061 | + | |
1058 | 1062 | | |
1059 | 1063 | | |
1060 | 1064 | | |
| |||
1076 | 1080 | | |
1077 | 1081 | | |
1078 | 1082 | | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1079 | 1114 | | |
1080 | 1115 | | |
1081 | 1116 | | |
| |||
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 | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
0 commit comments