Commit 6cbb834
chore(bors): merge pull request #1038
1038: feat(affinity-group): support scale down to 1 replica (backport #1037) r=tiagolobocastro a=mergify[bot]
Scaling down affinity groups to 1 replica was previously blocked because we didn't want to get into a situation where replicas would end up sharing the same node, defeating the purpose of Affinity Groups!
We now loosen this restriction by allowing the scale down if we don't get into that scenario :)
This is done by creating a list of restricted nodes which are nodes where a 1-replica volume part of the same affinity group places its replica. In such case, we don't want to scale down in such a way that the last remaining replica would be placed in restricted nodes!
This isn't the full monty as replicas may be sharing nodes when Scaling back from 3 to 2, which would end up impeding further scaling down to 1! For this we'd have to implement some logic to improve the sorting. This limitation is fine for now, we can document scaling up and down as a way of moving replicas around!<hr>This is an automatic backport of pull request #1037 done by [Mergify](https://mergify.com).
Co-authored-by: Tiago Castro <[email protected]>File tree
11 files changed
+386
-53
lines changed- .github
- control-plane/agents/src
- bin/core
- controller/scheduling
- resources
- tests/volume
- volume
- common
- tests/bdd/features/volume-group/set-replica
- utils/deployer-cluster/src
11 files changed
+386
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
64 | 85 | | |
65 | 86 | | |
66 | 87 | | |
| |||
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
342 | 352 | | |
343 | 353 | | |
344 | 354 | | |
| |||
377 | 387 | | |
378 | 388 | | |
379 | 389 | | |
| 390 | + | |
380 | 391 | | |
381 | 392 | | |
382 | 393 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
| |||
338 | 346 | | |
339 | 347 | | |
340 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
341 | 356 | | |
342 | 357 | | |
343 | 358 | | |
| |||
Lines changed: 102 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
276 | 291 | | |
277 | 292 | | |
278 | 293 | | |
| |||
282 | 297 | | |
283 | 298 | | |
284 | 299 | | |
| 300 | + | |
285 | 301 | | |
286 | 302 | | |
287 | 303 | | |
| |||
295 | 311 | | |
296 | 312 | | |
297 | 313 | | |
298 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
299 | 319 | | |
300 | 320 | | |
301 | 321 | | |
| |||
311 | 331 | | |
312 | 332 | | |
313 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
314 | 342 | | |
315 | 343 | | |
316 | 344 | | |
317 | | - | |
| 345 | + | |
| 346 | + | |
318 | 347 | | |
319 | 348 | | |
320 | 349 | | |
| |||
386 | 415 | | |
387 | 416 | | |
388 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
389 | 423 | | |
390 | 424 | | |
391 | 425 | | |
392 | 426 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
399 | 431 | | |
400 | | - | |
401 | | - | |
| 432 | + | |
| 433 | + | |
402 | 434 | | |
403 | 435 | | |
404 | 436 | | |
| |||
448 | 480 | | |
449 | 481 | | |
450 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
451 | 501 | | |
452 | 502 | | |
453 | 503 | | |
| |||
457 | 507 | | |
458 | 508 | | |
459 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
460 | 550 | | |
461 | 551 | | |
462 | 552 | | |
| |||
0 commit comments