Skip to content

fix(replica clusters): apply hot-standby parameter changes#9952

Merged
leonardoce merged 4 commits intomainfrom
dev/replica-update
Feb 19, 2026
Merged

fix(replica clusters): apply hot-standby parameter changes#9952
leonardoce merged 4 commits intomainfrom
dev/replica-update

Conversation

@armru
Copy link
Member

@armru armru commented Feb 10, 2026

In replica clusters, decreasing hot-standby sensitive parameters (e.g., max_connections) never triggered a restart because:

  1. pg_controldata values come from the external source primary via WAL, not from the local cluster's designated primary, making the pg_controldata comparison permanently unsatisfiable for replicas.

  2. The designated primary was not recognized as "primary-like" for restart purposes since IsPrimary is always false in replica clusters.

Skip the pg_controldata check for replica clusters and treat the designated primary as primary-like for in-place restart triggering.

Closes #9855

@armru armru requested a review from a team as a code owner February 10, 2026 16:19
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 10, 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 Feb 10, 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 bug 🐛 Something isn't working label Feb 10, 2026
@armru
Copy link
Member Author

armru commented Feb 10, 2026

/test

@github-actions
Copy link
Contributor

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

@armru
Copy link
Member Author

armru commented Feb 10, 2026

/test

@github-actions
Copy link
Contributor

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

@armru armru force-pushed the dev/replica-update branch from fd0bb6e to ac6a1ca Compare February 10, 2026 16:48
@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Feb 10, 2026
@gbartolini gbartolini changed the title fix: apply hot-standby parameter changes in replica clusters fix(replica clusters): apply hot-standby parameter changes Feb 16, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 16, 2026
armru and others added 4 commits February 19, 2026 13:15
In replica clusters, decreasing hot-standby sensitive parameters (e.g.,
max_connections) never triggered a restart because:

1. pg_controldata values come from the external source primary via WAL,
   not from the local cluster's designated primary, making the
   pg_controldata comparison permanently unsatisfiable for replicas.

2. The designated primary was not recognized as "primary-like" for
   restart purposes since IsPrimary is always false in replica clusters.

Skip the pg_controldata check for replica clusters and treat the
designated primary as primary-like for in-place restart triggering.

Closes #9855

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
@leonardoce leonardoce merged commit dfd8518 into main Feb 19, 2026
34 checks passed
@leonardoce leonardoce deleted the dev/replica-update branch February 19, 2026 12:25
leonardoce pushed a commit that referenced this pull request Feb 19, 2026
In replica clusters, decreasing hot-standby sensitive parameters (e.g.,
max_connections) never triggered a restart because:

1. pg_controldata values come from the external source primary via WAL,
not from the local cluster's designated primary, making the
pg_controldata comparison permanently unsatisfiable for replicas.

2. The designated primary was not recognized as "primary-like" for
restart purposes since IsPrimary is always false in replica clusters.

Skip the pg_controldata check for replica clusters and treat the
designated primary as primary-like for in-place restart triggering.

Closes #9855

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]>
(cherry picked from commit dfd8518)
leonardoce pushed a commit that referenced this pull request Feb 19, 2026
In replica clusters, decreasing hot-standby sensitive parameters (e.g.,
max_connections) never triggered a restart because:

1. pg_controldata values come from the external source primary via WAL,
not from the local cluster's designated primary, making the
pg_controldata comparison permanently unsatisfiable for replicas.

2. The designated primary was not recognized as "primary-like" for
restart purposes since IsPrimary is always false in replica clusters.

Skip the pg_controldata check for replica clusters and treat the
designated primary as primary-like for in-place restart triggering.

Closes #9855

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]>
(cherry picked from commit dfd8518)
(cherry picked from commit 014a478)
leonardoce pushed a commit that referenced this pull request Feb 19, 2026
In replica clusters, decreasing hot-standby sensitive parameters (e.g.,
max_connections) never triggered a restart because:

1. pg_controldata values come from the external source primary via WAL,
not from the local cluster's designated primary, making the
pg_controldata comparison permanently unsatisfiable for replicas.

2. The designated primary was not recognized as "primary-like" for
restart purposes since IsPrimary is always false in replica clusters.

Skip the pg_controldata check for replica clusters and treat the
designated primary as primary-like for in-place restart triggering.

Closes #9855

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]>
(cherry picked from commit dfd8518)
(cherry picked from commit 014a478)
(cherry picked from commit d82e589)
mnencia pushed a commit that referenced this pull request Feb 20, 2026
In replica clusters, decreasing hot-standby sensitive parameters (e.g.,
max_connections) never triggered a restart because:

1. pg_controldata values come from the external source primary via WAL,
not from the local cluster's designated primary, making the
pg_controldata comparison permanently unsatisfiable for replicas.

2. The designated primary was not recognized as "primary-like" for
restart purposes since IsPrimary is always false in replica clusters.

Skip the pg_controldata check for replica clusters and treat the
designated primary as primary-like for in-place restart triggering.

Closes #9855

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]>
(cherry picked from commit dfd8518)
(cherry picked from commit 014a478)
(cherry picked from commit d82e589)
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 bug 🐛 Something isn't working 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:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: max_connections not updated in replica Cluster

4 participants