Skip to content

fix: avoid concurrent updates on the designed primary - #5755

Merged
leonardoce merged 1 commit into
cloudnative-pg:mainfrom
leonardoce:concurrent-designed-primary
Oct 9, 2024
Merged

leonardoce merged 1 commit into
cloudnative-pg:mainfrom
leonardoce:concurrent-designed-primary

Conversation

@leonardoce

@leonardoce leonardoce commented Oct 8, 2024 •

Copy link
Copy Markdown
Contributor

This patch fixes a condition where a demoted replica cluster is stuck waiting for the primary to be demoted to a designed primary, due to a concurrent update on the Cluster CR by the operator and the instance manager.

The update by the instance manager is now using the update entrypoint instead of a patch, using the Kubernetes optimistic locking mechanism.

Closes: #5754

Release notes

Avoid concurrent status updates when demoting a primary to a designed primary, while demoting a primary cluster to a replica cluster.

@leonardoce
leonardoce requested a review from a team October 8, 2024 09:25
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 labels Oct 8, 2024
@github-actions

github-actions Bot commented Oct 8, 2024

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 concurrent-designed-primary branch from 9c030d9 to e18f0a2 Compare October 8, 2024 09:27
@leonardoce

Copy link
Copy Markdown
Contributor Author

@leonardoce

Copy link
Copy Markdown
Contributor Author

E2e tests are green!

@gbartolini
gbartolini requested review from armru and fcanovai October 8, 2024 19:13
This patch fixes a condition where a demoted replica cluster is stuck
waiting for the primary to be demoted to a designed primary, due to a
concurrent update on the Cluster CR by the operator and the instance
manager.

The update by the instance manager is now using the update entrypoint
instead of a patch, using the Kubernetes optimistic locking mechanism.

Closes: cloudnative-pg#5754

Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
@leonardoce
leonardoce force-pushed the concurrent-designed-primary branch from e18f0a2 to 7e722ee Compare October 9, 2024 08:13
@leonardoce

Copy link
Copy Markdown
Contributor Author

/ok-to-merge tests green

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Oct 9, 2024
@leonardoce
leonardoce merged commit 0f82afc into cloudnative-pg:main Oct 9, 2024
cnpg-bot pushed a commit that referenced this pull request Oct 9, 2024
This patch fixes a condition where a demoted replica cluster is stuck
waiting for the primary to be demoted to a designed primary, due to a
concurrent update on the Cluster CR by the operator and the instance
manager.

The update by the instance manager is now using the update method
instead of a patch, relying on the Kubernetes optimistic locking mechanism.

Closes: #5754

Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
(cherry picked from commit 0f82afc)
cnpg-bot pushed a commit that referenced this pull request Oct 9, 2024
This patch fixes a condition where a demoted replica cluster is stuck
waiting for the primary to be demoted to a designed primary, due to a
concurrent update on the Cluster CR by the operator and the instance
manager.

The update by the instance manager is now using the update method
instead of a patch, relying on the Kubernetes optimistic locking mechanism.

Closes: #5754

Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
(cherry picked from commit 0f82afc)
bentastic27 pushed a commit to bentastic27/cloudnative-pg that referenced this pull request Oct 11, 2024
…#5755)

This patch fixes a condition where a demoted replica cluster is stuck
waiting for the primary to be demoted to a designed primary, due to a
concurrent update on the Cluster CR by the operator and the instance
manager.

The update by the instance manager is now using the update method
instead of a patch, relying on the Kubernetes optimistic locking mechanism.

Closes: cloudnative-pg#5754

Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Signed-off-by: Ben Healey <[email protected]>
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]: demoted replica cluster stuck with all Pods being not ready

4 participants