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

K8SPG-648: fix patroni-version-check behaviour on startup #1081

Merged
merged 4 commits into from
Mar 13, 2025

Conversation

pooknull
Copy link
Contributor

@pooknull pooknull commented Mar 12, 2025

K8SPG-648 Powered by Pull Request Badge

https://perconadev.atlassian.net/browse/K8SPG-648

DESCRIPTION

Problem:
patroni-version-check is created multiple times on startup, when it should be created only once.

Cause:
Instance pods don't have imageID's on startup. Operator can't find the previous imageID in the empty slice of pod's imageID's and creates new version check.

Solution:
Add a check for an empty imageID slice.

This PR adds the following resources to the patroni-version-check pod:

limits:
    cpu: 100m
    memory: 64Mi
requests:
    cpu: 50m
    memory: 32Mi

Also, the pgv2.percona.com/custom-patroni-version annotation is added to disable patroni-version-check by overriding the patroni version with a custom value.

kind: PerconaPGCluster
metadata:
  name: cluster1
  annotations:
    pgv2.percona.com/custom-patroni-version: "4"

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

egegunes
egegunes previously approved these changes Mar 13, 2025
@@ -404,13 +404,23 @@ func (r *PGClusterReconciler) reconcilePatroniVersionCheck(ctx context.Context,
"bash",
},
Args: []string{
"-c", "sleep 300",
"-c", "sleep 60",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we can decrease it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need such a big sleep. Our reconcile loop should not take more than 1 minute

hors
hors previously approved these changes Mar 13, 2025
@hors hors dismissed stale reviews from egegunes and themself via 095ae06 March 13, 2025 09:26
@hors hors merged commit 6a80c22 into main Mar 13, 2025
16 of 17 checks passed
@hors hors deleted the fix-patroni-version-check-2 branch March 13, 2025 09:34
eleo007 pushed a commit that referenced this pull request Mar 13, 2025
* K8SPG-648: fix `patroni-version-check` behaviour on startup

https://perconadev.atlassian.net/browse/K8SPG-648

* better fix

* add `pgv2.percona.com/custom-patroni-version` annotation

* add example into cr.yaml

---------

Co-authored-by: Viacheslav Sarzhan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants