Commit d8c58a7
authored
host volumes: account for proposed allocs in unmet claims (#27470)
When a dynamic host volume requests are marked "sticky", we need to ensure that
any new allocations are preferentially placed on nodes with volumes that have
been previously claimed but are no longer claimed. But when we have multiple
allocations in an allocation, we're not counting allocations that have been
previously placed against the number of unmet claims. This results in placement
failures, particularly in cases where a volume has been deleted out from under
the claim.
Remove the proposed allocations from the list of claims in `SetVolumes`, which
is called at the start of each iteration of the nodes while looking for a
placement. Rework the test to exercise this behavior across placing multiple
allocations in an evaluation, including an allocation with a valid claim and one
that's been evicted.
Ref: https://hashicorp.atlassian.net/browse/NMD-1062
Fixes: #270021 parent 4c86c8c commit d8c58a7
3 files changed
Lines changed: 190 additions & 88 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
223 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
242 | 247 | | |
243 | 248 | | |
244 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
245 | 275 | | |
246 | 276 | | |
247 | 277 | | |
| |||
308 | 338 | | |
309 | 339 | | |
310 | 340 | | |
311 | | - | |
| 341 | + | |
312 | 342 | | |
313 | 343 | | |
314 | 344 | | |
315 | | - | |
| 345 | + | |
316 | 346 | | |
317 | 347 | | |
318 | 348 | | |
319 | 349 | | |
320 | 350 | | |
321 | 351 | | |
322 | | - | |
323 | | - | |
324 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
325 | 356 | | |
326 | 357 | | |
327 | 358 | | |
| |||
0 commit comments