Commit e6b3fea
authored
Account for Crucible Agent reservation overhead (#7885)
When creating a region's dataset, the Crucible Agent will include a
reservation 25% larger than the region's size to account for on-disk
overhead (storing encryption contexts and other metadata). Nexus does
not take this overhead into account when computing `size_used` for
crucible_dataset rows, or when allocating regions. This leads to the
scenario where Nexus thinks there's enough room for a region but the
Agent will fail to create the dataset due to not having enough space for
the reservation to succeed.
Fix this: add a reservation factor column to the Region model, and
account for this when performing region allocation and when computing
the `size_used` column for crucible datasets.
This commit also adds an upgrader that will set all currently allocated
Region's reservation factor to 1.25, and recompute all the `size_used`
values for all non-deleted crucible datasets. This may lead to
`size_used` being greater than the pool's total_size - a follow up
commit will add an omdb command to identify these cases, and identify
candidate regions to request replacement for in order to remedy this.
The `regions_hard_delete` function now uses this upgrader's CTE to set
`size_used` for all crucible datasets at once, instead of in a for loop
during an interactive transaction.1 parent 77c4136 commit e6b3fea
File tree
21 files changed
+689
-242
lines changed- nexus
- db-model/src
- db-queries
- src/db
- datastore
- queries
- tests/output
- db-schema/src
- src/app/sagas
- test-utils/src
- tests/integration_tests
- schema/crdb
- crucible-agent-reservation-overhead
21 files changed
+689
-242
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
| |||
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
58 | 76 | | |
59 | 77 | | |
60 | 78 | | |
| |||
77 | 95 | | |
78 | 96 | | |
79 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
80 | 102 | | |
81 | 103 | | |
82 | 104 | | |
| |||
112 | 134 | | |
113 | 135 | | |
114 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
115 | 157 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | 304 | | |
311 | 305 | | |
312 | 306 | | |
313 | | - | |
314 | 307 | | |
315 | 308 | | |
316 | | - | |
317 | | - | |
| 309 | + | |
318 | 310 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
324 | 316 | | |
325 | 317 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
366 | 346 | | |
367 | 347 | | |
368 | 348 | | |
| |||
373 | 353 | | |
374 | 354 | | |
375 | 355 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
| 356 | + | |
388 | 357 | | |
389 | 358 | | |
390 | | - | |
391 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
392 | 362 | | |
393 | 363 | | |
394 | 364 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
| 365 | + | |
411 | 366 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
417 | 373 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
| 374 | + | |
422 | 375 | | |
423 | 376 | | |
424 | 377 | | |
| |||
0 commit comments