This repository was archived by the owner on Dec 12, 2025. It is now read-only.
Commit f983783
authored
CLOUDP-119891: Change port of running cluster (#995)
* CLOUDP-119891: Change port of running cluster
This patchset improves reconfiguration of MongoDB's ports in the replica set.
MongoDB Agent does not support changing port of more than one process at a time in a replica set.
Changes:
* Introduced ReplicaSetPortManager to determine processes' ports in Service and Automation Config.
* Fixed handling nested map format (e.g. net.port) when unmarshalling MongodConfiguration
* Improved handling ports both as ints and float64 in MongodConfiguration and AutomationConfig
* Set explicit linux/amd64 platform when building agent-image, which fixes local builds on M1 macs.
Port change process:
* When the port (newPort) is customised, but there aren't any pods yet, then all processes are configured with the newPort in automation config. This works as before.
* When the cluster is running and the port is changed, each process need to be configured one by one:
* ReplicaSetPortManager changes port in automation config only when all pods reached its goal states.
* Until all processes are configured with newPort the service is configured with two ports: oldPort and newPort.
* When all pods are changed one by one, the service is reconfigured to have only newPort.
closes #9451 parent 5a0afe2 commit f983783
File tree
24 files changed
+983
-59
lines changed- .action_templates/jobs
- .github/workflows
- api/v1
- config/crd/bases
- controllers
- docs
- pkg
- agent
- automationconfig
- readiness/headless
- scripts/dev/templates/agent
- test/e2e
- mongodbtests
- replica_set_mongod_port_change_with_arbiters
- util/wait
24 files changed
+983
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
315 | 328 | | |
316 | 329 | | |
317 | 330 | | |
| |||
339 | 352 | | |
340 | 353 | | |
341 | 354 | | |
342 | | - | |
343 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
344 | 373 | | |
345 | 374 | | |
346 | 375 | | |
| |||
747 | 776 | | |
748 | 777 | | |
749 | 778 | | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
750 | 783 | | |
751 | 784 | | |
752 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
47 | 68 | | |
48 | 69 | | |
49 | 70 | | |
| |||
Lines changed: 0 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 8 | | |
15 | 9 | | |
16 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
446 | 449 | | |
447 | | - | |
| 450 | + | |
448 | 451 | | |
449 | 452 | | |
450 | | - | |
| 453 | + | |
451 | 454 | | |
452 | 455 | | |
453 | 456 | | |
454 | 457 | | |
455 | | - | |
| 458 | + | |
456 | 459 | | |
457 | 460 | | |
458 | 461 | | |
| |||
461 | 464 | | |
462 | 465 | | |
463 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
464 | 484 | | |
465 | 485 | | |
466 | 486 | | |
467 | 487 | | |
468 | 488 | | |
469 | | - | |
| 489 | + | |
470 | 490 | | |
471 | 491 | | |
472 | 492 | | |
| |||
528 | 548 | | |
529 | 549 | | |
530 | 550 | | |
531 | | - | |
532 | 551 | | |
533 | 552 | | |
534 | 553 | | |
535 | 554 | | |
536 | 555 | | |
537 | 556 | | |
538 | 557 | | |
539 | | - | |
| 558 | + | |
540 | 559 | | |
541 | 560 | | |
542 | 561 | | |
543 | 562 | | |
544 | 563 | | |
545 | | - | |
| 564 | + | |
546 | 565 | | |
547 | 566 | | |
548 | 567 | | |
549 | 568 | | |
550 | 569 | | |
551 | 570 | | |
552 | 571 | | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
| 572 | + | |
558 | 573 | | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
565 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
566 | 582 | | |
567 | 583 | | |
568 | 584 | | |
| |||
627 | 643 | | |
628 | 644 | | |
629 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
630 | 651 | | |
631 | 652 | | |
632 | 653 | | |
633 | 654 | | |
634 | 655 | | |
635 | 656 | | |
636 | 657 | | |
| 658 | + | |
637 | 659 | | |
| 660 | + | |
638 | 661 | | |
639 | 662 | | |
640 | 663 | | |
| |||
646 | 669 | | |
647 | 670 | | |
648 | 671 | | |
649 | | - | |
| 672 | + | |
650 | 673 | | |
651 | 674 | | |
652 | 675 | | |
| |||
703 | 726 | | |
704 | 727 | | |
705 | 728 | | |
706 | | - | |
| 729 | + | |
707 | 730 | | |
708 | 731 | | |
709 | 732 | | |
| |||
0 commit comments