Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent endless reconciliation when unsetting connection limit in roles #3832

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

jsilvela
Copy link
Collaborator

In the managed roles reconciler, the connection limit was only explicitly set
if it was not default (-1). This does not work as intended if the managed role
is trying to unset a connection limit that was not previously -1.
In this case the instance manager gets into indefinite reconciliation:

  • it recognizes the value in the DB is not the same as the manifest
  • since the manifest has the default connection limit, it makes no update

This patch always explicitly sets the connection limit when updating a role.

Closes #3831

@github-actions github-actions bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.21 release-1.22 labels Feb 15, 2024
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

@jsilvela
Copy link
Collaborator Author

/test feature_type=smoke

Copy link
Contributor

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

@mnencia
Copy link
Member

mnencia commented Mar 12, 2024

@mnencia
Copy link
Member

mnencia commented Mar 12, 2024

/ok-to-merge E2E green

…n a role

Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Mar 12, 2024
@mnencia mnencia merged commit 4d8516b into main Mar 12, 2024
32 checks passed
@mnencia mnencia deleted the dev/3831 branch March 12, 2024 12:06
cnpg-bot pushed a commit that referenced this pull request Mar 12, 2024
…n roles (#3832)

In the managed roles reconciler, the connection limit was only
explicitly set if it was not default (-1). This does not work as
intended if the managed role tries to unset a connection limit
that was not previously -1.

In this case the instance manager gets into indefinite reconciliation:

- it recognizes the value in the DB is not the same as the manifest
- since the manifest has the default connection limit, it makes no
  update

This patch always explicitly sets the connection limit when updating
a role.

Closes #3831

Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
(cherry picked from commit 4d8516b)
cnpg-bot pushed a commit that referenced this pull request Mar 12, 2024
…n roles (#3832)

In the managed roles reconciler, the connection limit was only
explicitly set if it was not default (-1). This does not work as
intended if the managed role tries to unset a connection limit
that was not previously -1.

In this case the instance manager gets into indefinite reconciliation:

- it recognizes the value in the DB is not the same as the manifest
- since the manifest has the default connection limit, it makes no
  update

This patch always explicitly sets the connection limit when updating
a role.

Closes #3831

Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
(cherry picked from commit 4d8516b)
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 release-1.21 release-1.22
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: unsetting the Connection Limit in a managed role causes indefinite reconcile loops
4 participants