Commit 95696ef
committed
avoid floating point math
reservation right now is 25%, which means that the requested size of a
region can be divided by 4. avoid floating point math where possible.
change the reservation percentage stored with the region to an enum,
where the only value is 25%. this limits what can be done with manual
database edits, and restricts what the Region::reserved_size function
has to guard against.
it'd be nice if Region::new was a test-only function but the crate
doesn't have the same idea of a integration test feature.1 parent e6b489a commit 95696ef
File tree
19 files changed
+313
-170
lines changed- nexus
- db-model/src
- db-queries
- src/db
- datastore
- queries
- tests/output
- reconfigurator/execution/src
- src/app
- background/tasks
- sagas
- schema/crdb
- crucible-agent-reservation-overhead
19 files changed
+313
-170
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 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
18 | 32 | | |
19 | 33 | | |
20 | 34 | | |
| |||
58 | 72 | | |
59 | 73 | | |
60 | 74 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
64 | 79 | | |
65 | 80 | | |
66 | 81 | | |
67 | | - | |
68 | 82 | | |
69 | 83 | | |
70 | 84 | | |
| |||
73 | 87 | | |
74 | 88 | | |
75 | 89 | | |
76 | | - | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
| |||
85 | 98 | | |
86 | 99 | | |
87 | 100 | | |
88 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
89 | 105 | | |
90 | 106 | | |
91 | 107 | | |
| |||
122 | 138 | | |
123 | 139 | | |
124 | 140 | | |
125 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
126 | 144 | | |
127 | 145 | | |
128 | 146 | | |
| |||
133 | 151 | | |
134 | 152 | | |
135 | 153 | | |
136 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
137 | 159 | | |
138 | 160 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1126 | 1126 | | |
1127 | 1127 | | |
1128 | 1128 | | |
1129 | | - | |
| 1129 | + | |
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4715 | 4715 | | |
4716 | 4716 | | |
4717 | 4717 | | |
4718 | | - | |
4719 | 4718 | | |
4720 | 4719 | | |
4721 | 4720 | | |
| |||
4953 | 4952 | | |
4954 | 4953 | | |
4955 | 4954 | | |
4956 | | - | |
4957 | 4955 | | |
4958 | 4956 | | |
4959 | 4957 | | |
| |||
0 commit comments