-
Notifications
You must be signed in to change notification settings - Fork 133
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
avoid concurrent processing of same PVC #6
Conversation
/assign @gnufied |
The PR looks okay but I am thinking if there is a better way of handling this. Lets not merge this for now until we consider other approaches. This PR is not blocking us from doing rest of the external resizer work, so we can merge this later as well. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mlmhl 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 |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
I have been thinking about this and I think rather than doing a previous version check etc, we should always default to doing a resourceVersion check while patching PVC and PV in this PR. This would solve majority of duplicate processing problems and I think it should be safe enough. @mlmhl what do you think? Can you update this PR to do that? |
@gnufied Agreed. And the PR is already updated, PTAL :) |
pkg/controller/controller.go
Outdated
// If pvc's ResourceVersion is equal to last processed ResourceVersion, it means this is a resync event, | ||
// so we need to check PVC's version when patch its status to avoid double process on same PVC. | ||
// More details see: https://github.com/kubernetes-csi/external-resizer/issues/4. | ||
needVersionCheck := ctrl.lastProcessedPVCVersions.Get(key) == pvc.ResourceVersion |
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, lets not do all this stuff. Just add resource version to PVC and PV patch unconditionally. Let the patch operation fail and retry if we had stale object.
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.
Oh, got it. Updated.
14f8899
to
97dc262
Compare
/lgtm |
UPSTREAM: 60: Build Windows only for amd64
This PR try to handle double processing of PVCs correctly.
The resize controller will receive PVC Update events periodically due to
SharedInformer
's resync mechanism, when handling these events, we need to check PVC'sResourceVersion
to avoid race condition between controller and kubelet.xref: #4