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:claim cached in pvcontroller is not the newest may cause unexpected issue #105211
fix:claim cached in pvcontroller is not the newest may cause unexpected issue #105211
Conversation
Hi @xiaopingrubyist. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign |
/assign @msau42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
/assign @jsafrane
for more eyes
claim = nil | ||
// in some cases, the cached claim is not the newest, and the volume.Spec.ClaimRef.UID is newer than cached. | ||
// in this case ,we should double check by calling apiserver to get the newest claim. | ||
klog.V(3).Infof("Maybe cached claim: %s is not the newest one, we should fetch it from apiserver", claimrefToClaimKey(volume.Spec.ClaimRef)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably keep this level at 4 with the other messages here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will update it and back to level 4.
be81036
to
df95536
Compare
59fd7c5
to
9d0652c
Compare
/retest |
@xiaopingrubyist your go fmt is failing. You can run |
@xiaopingrubyist also be sure to follow the PR template. I'm just trying to help you get this PR reviewed, because it seems you have put some effort into tracking down the cause of this problem. |
thank you so much , i will update it. |
/retest |
/retest-required |
/test pull-kubernetes-e2e-gce-storage-slow |
if claim.UID != volume.Spec.ClaimRef.UID { | ||
klog.V(4).Infof("synchronizing PersistentVolume[%s]: claim %s has different UID, the old one must have been deleted", volume.Name, claimrefToClaimKey(volume.Spec.ClaimRef)) | ||
claim = nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a log that the newly retrieved claim is newer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant, now the controller logs
Maybe cached claim: %s is not the newest one, we should fetch it from apiserver
If the retrieved PVC is wrong, it then logs:
synchronizing PersistentVolume[%s]: claim %s has a newer UID than pv.ClaimRef, the old one must have been deleted
This is fine.
But if the retrieved PVC is OK, there is no log, which leaves potential log reader with confusing "we should fetch it from apiserver", but no result of the fetch. Can you add else
and some log that the fetched PVC is OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, updated
90459a7
to
2f5b0da
Compare
The code looks good now. Can you please squash the commits and provide a release note in the initial comment of this PR? This is a bug that might be interesting to some users and they should find it's fixed in the release notes. Follow https://www.kubernetes.dev/docs/guide/release-notes/#applying-a-release-note /triage accepted |
2f5b0da
to
f28a8d7
Compare
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
released notes added and commits squashed. @jsafrane |
Thanks a lot for your PR! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, xiaopingrubyist The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Which issue(s) this PR fixes:
What this PR does / why we need it:
fix issue: #105131
Which issue(s) this PR fixes:
Fixes #<105131>