Skip to content

fix: delay rollout until every Pods received the same configuration - #6991

Merged
mnencia merged 6 commits into
cloudnative-pg:mainfrom
leonardoce:dev/two-phase-configuration-commit
Mar 6, 2025
Merged

mnencia merged 6 commits into
cloudnative-pg:mainfrom
leonardoce:dev/two-phase-configuration-commit

Conversation

@leonardoce

@leonardoce leonardoce commented Feb 26, 2025 •

Copy link
Copy Markdown
Contributor

This patch delays the rollout of Pods to the point where every instance manager received the latest PostgreSQL configuration and applied it.

This prevents the operator from switching over two times to apply the same configuration when the primary received the configuration and, immediately after that, a reconciliation loop has been triggered on the cluster.

Fixes: #6956

Release notes

Prevent a race condition causing the operator to perform two switchovers to update
the PostgreSQL configuration.

@leonardoce
leonardoce requested a review from a team February 26, 2025 14:58
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 labels Feb 26, 2025
@github-actions

Copy link
Copy Markdown
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

@leonardoce
leonardoce force-pushed the dev/two-phase-configuration-commit branch from 20450e5 to c573d04 Compare February 26, 2025 14:59
@leonardoce

Copy link
Copy Markdown
Contributor Author

@armru armru self-assigned this Feb 26, 2025
@leonardoce
leonardoce force-pushed the dev/two-phase-configuration-commit branch 3 times, most recently from 8fb41f1 to b0cc4cf Compare February 27, 2025 07:38
@leonardoce

Copy link
Copy Markdown
Contributor Author

@leonardoce
leonardoce force-pushed the dev/two-phase-configuration-commit branch 2 times, most recently from 5132f5f to c95f1ae Compare February 27, 2025 16:24
@armru armru removed their assignment Feb 27, 2025
@leonardoce
leonardoce force-pushed the dev/two-phase-configuration-commit branch from c95f1ae to dd4d58c Compare February 28, 2025 08:11
@leonardoce leonardoce assigned leonardoce and unassigned leonardoce Feb 28, 2025
@leonardoce
leonardoce force-pushed the dev/two-phase-configuration-commit branch from dd4d58c to 7a6b371 Compare February 28, 2025 08:26
Comment thread pkg/management/postgres/probes.go Resolved
@jsilvela
jsilvela force-pushed the dev/two-phase-configuration-commit branch from 03cd85d to fa91e74 Compare March 5, 2025 14:44
@jsilvela

jsilvela commented Mar 5, 2025

Copy link
Copy Markdown
Contributor

leonardoce and others added 3 commits March 6, 2025 14:33
This patch delays the rollout of Pods to the point where every
instance manager received the latest PostgreSQL configuration and
applied it.

This prevents the operator from swiching over two times to apply the
same configuration when the primary received the configuration and,
immediately after that, a reconciliation loop has been triggered on
the cluster.

Fixes: cloudnative-pg#6956

Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
@mnencia
mnencia force-pushed the dev/two-phase-configuration-commit branch from fa91e74 to 05e2f60 Compare March 6, 2025 13:33
@mnencia

mnencia commented Mar 6, 2025

Copy link
Copy Markdown
Member

/test tl=4 d=main

@github-actions

github-actions Bot commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

Signed-off-by: Marco Nenciarini <[email protected]>
@mnencia
mnencia force-pushed the dev/two-phase-configuration-commit branch from 37b0a0a to ebd422b Compare March 6, 2025 14:51
Signed-off-by: Marco Nenciarini <[email protected]>
@mnencia

mnencia commented Mar 6, 2025

Copy link
Copy Markdown
Member

/test tl=4 d=main ft=postgres-configuration

@github-actions

github-actions Bot commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Mar 6, 2025
@mnencia
mnencia merged commit 8669af5 into cloudnative-pg:main Mar 6, 2025
cnpg-bot pushed a commit that referenced this pull request Mar 6, 2025
…6991)

This patch delays the rollout of Pods to the point where every instance
manager received the latest PostgreSQL configuration and applied it.

This prevents the operator from switching over two times to apply the
same configuration when the primary received the configuration and,
immediately after that, a reconciliation loop has been triggered on the
cluster.

Fixes #6956

Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 8669af5)
cnpg-bot pushed a commit that referenced this pull request Mar 6, 2025
…6991)

This patch delays the rollout of Pods to the point where every instance
manager received the latest PostgreSQL configuration and applied it.

This prevents the operator from switching over two times to apply the
same configuration when the primary received the configuration and,
immediately after that, a reconciliation loop has been triggered on the
cluster.

Fixes #6956

Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 8669af5)
mnencia added a commit that referenced this pull request Mar 6, 2025
…6991)

This patch delays the rollout of Pods to the point where every instance
manager received the latest PostgreSQL configuration and applied it.

This prevents the operator from switching over two times to apply the
same configuration when the primary received the configuration and,
immediately after that, a reconciliation loop has been triggered on the
cluster.

Fixes #6956

Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Jaime Silvela <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 8669af5)
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 ok to merge 👌 This PR can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: double switchover on configuration upgrade

5 participants