Skip to content

Conversation

pooknull
Copy link
Contributor

@pooknull pooknull commented Sep 29, 2025

K8SPS-498 Powered by Pull Request Badge

https://perconadev.atlassian.net/browse/K8SPS-498

DESCRIPTION

Problem:
While the cluster is initializing, the cluster's resourceVersion is constantly updated.

Cause:
This happens because status conditions are continuously updated with an incorrect latestTransitionTime. The reconcileCRStatus method is used in multiple places in the reconcile loop, and whenever it is called, it updates the status conditions with an outdated/incorrect latestTransitionTime, based on the cluster passed to the method.

Solution:
Always fetch the latest cluster in the reconcileCRStatus method.

Note for developers: I removed LatestTransitionTime from the condition objects because it is already managed by the meta.SetStatusCondition function

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 PS version?
  • Does the change support oldest and newest supported Kubernetes version?

@pull-request-size pull-request-size bot added the size/S 10-29 lines label Sep 29, 2025
Comment on lines +37 to +39
if err := r.Get(ctx, client.ObjectKeyFromObject(cr), cr); err != nil {
return errors.Wrap(err, "get cluster")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this will overwrite anything we assign to status fields in Reconcile function, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but it shouldn't cause any issues since we overwrite each field of the status in the reconcileCRStatus method

Copy link
Contributor

Choose a reason for hiding this comment

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

i am not sure if it's okay, users test failure might be caused by this

@hors hors added this to the v1.0.0 milestone Sep 30, 2025
@pull-request-size pull-request-size bot added size/M 30-99 lines and removed size/S 10-29 lines labels Sep 30, 2025
@pooknull pooknull marked this pull request as ready for review September 30, 2025 12:45
Copy link
Contributor

@gkech gkech left a comment

Choose a reason for hiding this comment

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

seems fine, also tested it locally and I don't see the init spam of k get ps -w

@JNKPercona
Copy link
Collaborator

Test Name Result Duration
version-service failure 00:11:20
async-ignore-annotations passed 00:00:00
async-global-metadata passed 00:00:00
auto-config passed 00:00:00
config passed 00:00:00
config-router passed 00:00:00
demand-backup-minio passed 00:00:00
demand-backup-cloud passed 00:00:00
async-data-at-rest-encryption passed 00:00:00
gr-global-metadata passed 00:00:00
gr-data-at-rest-encryption passed 00:00:00
gr-demand-backup-minio passed 00:00:00
gr-demand-backup-cloud passed 00:00:00
gr-demand-backup-haproxy passed 00:00:00
gr-finalizer passed 00:00:00
gr-haproxy passed 00:00:00
gr-ignore-annotations passed 00:00:00
gr-init-deploy passed 00:00:00
gr-one-pod passed 00:00:00
gr-recreate passed 00:00:00
gr-scaling passed 00:00:00
gr-scheduled-backup passed 00:00:00
gr-security-context passed 00:00:00
gr-self-healing passed 00:00:00
gr-tls-cert-manager passed 00:00:00
gr-users passed 00:00:00
haproxy passed 00:00:00
init-deploy passed 00:00:00
limits passed 00:00:00
monitoring passed 00:00:00
one-pod passed 00:00:00
operator-self-healing passed 00:00:00
recreate passed 00:00:00
scaling passed 00:00:00
scheduled-backup passed 00:00:00
service-per-pod passed 00:00:00
sidecars passed 00:00:00
smart-update passed 00:00:00
storage passed 00:00:00
telemetry passed 00:00:00
tls-cert-manager passed 00:00:00
users failure 00:05:03
pvc-resize passed 00:00:00
We run 43 out of 43 00:16:23

commit: 3017821
image: perconalab/percona-server-mysql-operator:PR-1102-3017821d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M 30-99 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants