Skip to content

feat(rollout): honor primaryUpdateMethod when adding PVCs#9720

Merged
mnencia merged 17 commits intomainfrom
dev/5564
Feb 19, 2026
Merged

feat(rollout): honor primaryUpdateMethod when adding PVCs#9720
mnencia merged 17 commits intomainfrom
dev/5564

Conversation

@jsilvela
Copy link
Collaborator

@jsilvela jsilvela commented Jan 14, 2026

Currently, when upgrading a cluster to add a new tablespace or set
a dedicated WAL volume, the configured choice of
primaryUpdateMethod is ignored, and primary restart is forced.
This PR enables cluster upgrade for these cases to proceed with
primary switchover if so configured.

Closes #5564
Closes #5484

@jsilvela jsilvela requested review from a team, NiccoloFei and litaocdl as code owners January 14, 2026 14:59
@jsilvela jsilvela marked this pull request as draft January 14, 2026 14:59
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 14, 2026
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.27 release-1.28 labels Jan 14, 2026
@github-actions
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@dosubot dosubot bot added the enhancement 🪄 New feature or request label Jan 14, 2026
@jsilvela
Copy link
Collaborator Author

/test depth=push test_level=4 feature_type=basic

@github-actions
Copy link
Contributor

@jsilvela, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/20998879371

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jan 14, 2026
@jsilvela jsilvela changed the title feat: enable primary switchover when adding new tablespaces feat(tablespaces): enable primary switchover when adding new tablespaces Jan 14, 2026
@jsilvela
Copy link
Collaborator Author

/test depth=push test_level=4 feature_type=basic

@github-actions
Copy link
Contributor

@jsilvela, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21003605175

@jsilvela
Copy link
Collaborator Author

/test depth=push test_level=4 feature_type=storage

@github-actions
Copy link
Contributor

@jsilvela, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21291363627

@jsilvela
Copy link
Collaborator Author

/test

@github-actions
Copy link
Contributor

@jsilvela, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21294268184

@jsilvela jsilvela changed the title feat(tablespaces): enable primary switchover when adding new tablespaces feat: enable primary switchover when upgrading a cluster for PVC volume or tablespaces Jan 26, 2026
@jsilvela jsilvela changed the title feat: enable primary switchover when upgrading a cluster for PVC volume or tablespaces feat: enable primary switchover on cluster upgrade due to addition of tablespace or WAL volume Jan 26, 2026
@jsilvela jsilvela marked this pull request as ready for review January 26, 2026 15:56
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 26, 2026
jsilvela and others added 6 commits February 19, 2026 14:53
Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Jaime Silvela <[email protected]>
Refactor arePVCsForTablespaceHealthy into buildPVCChecker that builds the
healthy PVC lookup map once per reconciliation instead of per-tablespace.
Downgrade log level from Warning to Info since unhealthy PVCs during rollout
are an expected transient state. Add direct unit tests for the PVC checker
covering edge cases (all healthy, partial, empty instances, no healthy PVCs).

Signed-off-by: Armando Ruocco <[email protected]>
Rename AssertPrimaryWasUpdated to AssertPrimaryUpdateMethod and
fix trailing space in tablespace creation log message.

Signed-off-by: Marco Nenciarini <[email protected]>
Replace struct parameters with the string names actually used,
and move podList.LogStatus to the caller.

Signed-off-by: Marco Nenciarini <[email protected]>
Separate AssertClusterIsReady into its own By block in the
switchover context to match the restart context structure.

Signed-off-by: Marco Nenciarini <[email protected]>
@mnencia
Copy link
Member

mnencia commented Feb 19, 2026

/test

@github-actions
Copy link
Contributor

@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/22184688312

@mnencia mnencia linked an issue Feb 19, 2026 that may be closed by this pull request
4 tasks
@mnencia mnencia removed the ok to merge 👌 This PR can be merged label Feb 19, 2026
@mnencia
Copy link
Member

mnencia commented Feb 19, 2026

/ok-to-merge E2E failed for a network error.

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Feb 19, 2026
Only createTablespaceAction needs the PVC health check. Store it
as a field instead of polluting the tablespaceReconcilerStep
interface with a parameter ignored by the other implementations.

Signed-off-by: Marco Nenciarini <[email protected]>
@mnencia mnencia changed the title feat: enable primary switchover on cluster upgrade due to addition of a tablespace or WAL volume feat(rollout): honor primaryUpdateMethod when adding PVCs Feb 19, 2026
@mnencia
Copy link
Member

mnencia commented Feb 19, 2026

/test

@github-actions
Copy link
Contributor

@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/22192195550

@mnencia mnencia merged commit 9d216d2 into main Feb 19, 2026
35 checks passed
@mnencia mnencia deleted the dev/5564 branch February 19, 2026 19:58
cnpg-bot pushed a commit that referenced this pull request Feb 19, 2026
Currently, when upgrading a cluster to add a new tablespace or set
a dedicated WAL volume, the configured choice of
`primaryUpdateMethod` is ignored, and primary restart is forced.
This PR enables cluster upgrade for these cases to proceed with
primary switchover if so configured.

Closes #5564
Closes #5484

Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 9d216d2)
cnpg-bot pushed a commit that referenced this pull request Feb 19, 2026
Currently, when upgrading a cluster to add a new tablespace or set
a dedicated WAL volume, the configured choice of
`primaryUpdateMethod` is ignored, and primary restart is forced.
This PR enables cluster upgrade for these cases to proceed with
primary switchover if so configured.

Closes #5564
Closes #5484

Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 9d216d2)
mnencia added a commit that referenced this pull request Feb 20, 2026
Currently, when upgrading a cluster to add a new tablespace or set
a dedicated WAL volume, the configured choice of
`primaryUpdateMethod` is ignored, and primary restart is forced.
This PR enables cluster upgrade for these cases to proceed with
primary switchover if so configured.

Closes #5564
Closes #5484

Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 9d216d2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases enhancement 🪄 New feature or request lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged release-1.25 release-1.27 release-1.28 size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Tablespace addition should work with Primary Switchover [Bug]: primary pod is not switchover when add new wal volume

5 participants