Commit 42d86cd
authored
[reconfigurator] Rework planner/builder expungement logic (#7495)
The high-level summary of this change is that it moves the logic for
handling expunged sleds out of
`BlueprintBuilder::expunge_zones_for_sled()` (which is now gone
entirely) and into a new method on the planner
(`do_plan_expunge_for_commissioned_sled()`, naming suggestions welcome).
This fixes two problems; one stylistic, and one semantic:
1. `BlueprintBuilder::expunge_zones_for_sled()` was maybe the worst
offender for "is this a builder API or a planner API", because a big
chunk of its logic was actually delegated back to
`zone_needs_expungement()`, a helper function defined in the planner.
The builder now has more explicit and direct methods to expunge specific
things, and it's the planner that decides based on the planning input
which things to expunge.
2. `BlueprintBuilder::expunge_zones_for_sled()` only handled expunging
_zones_. When a sled was expunged, at no point did the planner expunge
the disks or datasets on that sled. We haven't been bitten by this yet
because the builder currently omits expunged sleds from
`blueprint_disks` and `blueprint_datasets` entirely, but that's a major
roadblock in the path to joining the maps together (which is a prereq
for fixing #7309 by merging sled-agent endpoints together).
`do_plan_expunge_for_commissioned_sled()` expunges disks, datasets, and
zones. For now we still omit the expunged sleds from `blueprint_disks`
and `blueprint_datasets`, but when we stop doing that we'll at least
have set the dispositions correctly.1 parent 66b8423 commit 42d86cd
File tree
9 files changed
+361
-257
lines changed- nexus/reconfigurator/planning
- src
- blueprint_builder
- blueprint_editor
- sled_editor
- tests/output
9 files changed
+361
-257
lines changedLines changed: 190 additions & 140 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
Lines changed: 58 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
71 | 81 | | |
72 | 82 | | |
73 | 83 | | |
| |||
236 | 246 | | |
237 | 247 | | |
238 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
239 | 267 | | |
240 | 268 | | |
241 | 269 | | |
| |||
277 | 305 | | |
278 | 306 | | |
279 | 307 | | |
280 | | - | |
| 308 | + | |
281 | 309 | | |
282 | 310 | | |
283 | 311 | | |
| |||
292 | 320 | | |
293 | 321 | | |
294 | 322 | | |
295 | | - | |
| 323 | + | |
296 | 324 | | |
297 | 325 | | |
298 | 326 | | |
| |||
437 | 465 | | |
438 | 466 | | |
439 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
440 | 475 | | |
441 | 476 | | |
442 | 477 | | |
| |||
465 | 500 | | |
466 | 501 | | |
467 | 502 | | |
468 | | - | |
469 | | - | |
| 503 | + | |
| 504 | + | |
470 | 505 | | |
471 | 506 | | |
472 | 507 | | |
473 | | - | |
474 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
475 | 518 | | |
476 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
477 | 525 | | |
478 | 526 | | |
479 | 527 | | |
| |||
499 | 547 | | |
500 | 548 | | |
501 | 549 | | |
502 | | - | |
| 550 | + | |
503 | 551 | | |
504 | 552 | | |
505 | 553 | | |
| |||
513 | 561 | | |
514 | 562 | | |
515 | 563 | | |
516 | | - | |
| 564 | + | |
517 | 565 | | |
518 | 566 | | |
519 | 567 | | |
| |||
524 | 572 | | |
525 | 573 | | |
526 | 574 | | |
527 | | - | |
| 575 | + | |
528 | 576 | | |
529 | 577 | | |
530 | 578 | | |
| |||
Lines changed: 13 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
| |||
125 | 122 | | |
126 | 123 | | |
127 | 124 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 125 | | |
134 | 126 | | |
135 | 127 | | |
| |||
138 | 130 | | |
139 | 131 | | |
140 | 132 | | |
141 | | - | |
142 | 133 | | |
143 | 134 | | |
144 | 135 | | |
| |||
160 | 151 | | |
161 | 152 | | |
162 | 153 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 154 | + | |
166 | 155 | | |
167 | 156 | | |
168 | 157 | | |
169 | 158 | | |
170 | 159 | | |
171 | | - | |
172 | 160 | | |
173 | 161 | | |
174 | 162 | | |
| |||
180 | 168 | | |
181 | 169 | | |
182 | 170 | | |
183 | | - | |
184 | 171 | | |
185 | 172 | | |
186 | 173 | | |
| |||
197 | 184 | | |
198 | 185 | | |
199 | 186 | | |
200 | | - | |
201 | 187 | | |
202 | 188 | | |
203 | 189 | | |
| |||
210 | 196 | | |
211 | 197 | | |
212 | 198 | | |
213 | | - | |
| 199 | + | |
214 | 200 | | |
215 | 201 | | |
216 | 202 | | |
| |||
220 | 206 | | |
221 | 207 | | |
222 | 208 | | |
| 209 | + | |
223 | 210 | | |
224 | 211 | | |
225 | 212 | | |
| 213 | + | |
226 | 214 | | |
227 | 215 | | |
228 | | - | |
229 | 216 | | |
230 | 217 | | |
231 | 218 | | |
| |||
252 | 239 | | |
253 | 240 | | |
254 | 241 | | |
255 | | - | |
| 242 | + | |
256 | 243 | | |
257 | 244 | | |
258 | | - | |
| 245 | + | |
259 | 246 | | |
260 | 247 | | |
| 248 | + | |
261 | 249 | | |
262 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
263 | 253 | | |
| 254 | + | |
| 255 | + | |
264 | 256 | | |
265 | 257 | | |
266 | 258 | | |
| |||
340 | 332 | | |
341 | 333 | | |
342 | 334 | | |
343 | | - | |
344 | 335 | | |
345 | 336 | | |
346 | 337 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
114 | | - | |
| 117 | + | |
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
173 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
174 | 177 | | |
175 | 178 | | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| |||
0 commit comments