kubernetes-sigs / vsphere-csi-driver

vSphere storage Container Storage Interface (CSI) plugin
https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/index.html
Apache License 2.0
296 stars 179 forks source link

Set metadatasyncer to wait initial period before making call to VC #2920

Closed adikul30 closed 3 months ago

adikul30 commented 3 months ago

What this PR does / why we need it:

2839 changed the deprecated Poll() to PollUntilContextTimeout()

err := wait.Poll(5*time.Second, time.Minute, func() (bool, error)

to

err = wait.PollUntilContextTimeout(ctx, 5*time.Second, time.Minute, true,
            func(ctx context.Context) (bool, error)

The true arg stands for immediate polling. So, the earlier behavior waited for 5 seconds initially before making the call to VC. In the new method, there is no initial wait.

In a perf test, this translated to more metadata sync operations lowering the number of other volume operations (create, delete) that CNS can handle. As a result, the number of operations of create volume and delete volume for the test dropped.

Passing immediate = false should make the behavior same as before.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Testing done: Perf test recovered original perf

| wl3_createpvc_thd128/csibench-128threads-cns.json |     |         |           |    100.0 |           52.188 |     128.195 |

Special notes for your reviewer:

Release note:

Set metadatasyncer to wait initial period before making call to VC
k8s-ci-robot commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adikul30, divyenpatel

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/vsphere-csi-driver/blob/master/OWNERS)~~ [adikul30,divyenpatel] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
divyenpatel commented 3 months ago

/lgtm