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

Add separate workqueue for unsaved PVs #33

Merged

Conversation

jsafrane
Copy link
Contributor

Work in progress:

  • Missing unit tests.
  • Deprecate other CreateProvisionedPV* options?

This PR yet another configuration option to run provisioning controller with a separate workqueue of unsaved PVs (their client.CoreV1().PersistentVolumes().Create(volume) failed).

The workqueue gets its limiter from provisioner, exponential backoff is expected. When a PV enters the queue, it cannot be deleted, i.e. the controller tries to create the PV even if user deleted corresponding PVC. Expectation is that API server error is a temporary hiccup that's going to be resolved quickly or the provisioner looses its leadership and exits. Unsaved PVs are lost in this case (or when the controller exits from any other reason)!

cc @wongma7 @msau42

I'd also suggest that at least CreateProvisionedPVBackoff option is deprecated and removed in a next release.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 27, 2019
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 27, 2019
@jsafrane jsafrane force-pushed the pv-save-retry-workqueue branch from f58fcf3 to e2acbb3 Compare February 27, 2019 14:40
@jsafrane jsafrane force-pushed the pv-save-retry-workqueue branch 2 times, most recently from 4b0e843 to dc9d3c9 Compare February 28, 2019 11:49
@jsafrane jsafrane force-pushed the pv-save-retry-workqueue branch from dc9d3c9 to e001d72 Compare March 4, 2019 10:15
@jsafrane jsafrane force-pushed the pv-save-retry-workqueue branch from e001d72 to 86d0187 Compare March 4, 2019 11:35
@jsafrane jsafrane changed the title WIP: Add separate workqueue for unsaved PVs Add separate workqueue for unsaved PVs Mar 4, 2019
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 4, 2019
@jsafrane jsafrane force-pushed the pv-save-retry-workqueue branch from 86d0187 to 84dad7d Compare March 4, 2019 11:36
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 4, 2019
@jsafrane
Copy link
Contributor Author

jsafrane commented Mar 4, 2019

Added unit tests and removed WIP:, ready for review.

@jsafrane jsafrane force-pushed the pv-save-retry-workqueue branch from 84dad7d to 8ab08f2 Compare March 4, 2019 11:38
c.createProvisionedPVInterval = createProvisionedPVInterval
return nil
}
}

// CreateProvisionedPVBackoff is the configuration of exponential backoff between retries when we create a
// PV object for a provisioned volume. Defaults to linear backoff, 10 seconds 5 times.
// If PV is not saved after given number of retries, corresponding storage asset (volume) is deleted!
// Only one of CreateProvisionedPVInterval+CreateProvisionedPVRetryCount or CreateProvisionedPVBackoff
// can be used.
Copy link
Contributor

Choose a reason for hiding this comment

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

still want to deprecate this?
Deprecated: Use CreateProvisionedPVLimiter instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

Factor: 1, // linear backoff
Steps: controller.createProvisionedPVRetryCount,
Cap: controller.createProvisionedPVInterval,
if controller.createProvisionerPVLimiter != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

should it be default someday? is there any performance hit? I guess it does not matter as long as csi-provisioner uses 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.

I'd say eventually it should be default, but after a long deprecation period. As you wrote, csi-provisioner is going to use it and that's what matters.


var _ VolumeStore = &queueStore{}

func NewVolumeStoreQueue(
Copy link
Contributor

Choose a reason for hiding this comment

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

need comment to pass repo-infra

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


var _ VolumeStore = &backoffStore{}

func NewBackoffStore(client kubernetes.Interface,
Copy link
Contributor

Choose a reason for hiding this comment

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

need comment to pass repo-infra

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@jsafrane jsafrane force-pushed the pv-save-retry-workqueue branch from 8ab08f2 to f7a8a33 Compare March 5, 2019 09:24
@wongma7
Copy link
Contributor

wongma7 commented Mar 5, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 5, 2019
@k8s-ci-robot k8s-ci-robot merged commit 0fcd2a1 into kubernetes-sigs:master Mar 5, 2019
humblec pushed a commit to humblec/sig-storage-lib-external-provisioner that referenced this pull request Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants