api
api copied to clipboard
[Driver] Enhancement for concurrency
What this PR does / why we need it: This PR is for enhancement for concurrency scenarios at driver side
Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #
This PR fixes attach part of the issue : #1197
Special notes for your reviewer:
Any other PR(s) this PR is dependant on: https://github.com/opensds/opensds/pull/1194 (Contains some base function for concurrency handling)
Test Steps: Create multiple attachments through multiple pod creation simultaneously Verify the volume and attachments states
Release note:
The issue of concurrency happens just because there is no proper error handling? Can there be a case that: a) Volume is created and attach request is made b) Port X, is specified but the Port status is not changed from available->unavailable yet c) Another Volume created and attach request made d) It finds that Port X is still available, now there may be a race condtion e) Should we wait for the next attachment request or keep a list of available and unavailable port? May be some network lag may cause attach/detach request to fall into race condition. Just thinking...
Can you please check CI issues
@sushanthakumar Please check the CI issue
Codecov Report
Merging #1195 into development will decrease coverage by
0.16%
. The diff coverage is3.27%
.
@@ Coverage Diff @@
## development #1195 +/- ##
===============================================
- Coverage 34.82% 34.66% -0.17%
===============================================
Files 97 97
Lines 17622 17705 +83
===============================================
Hits 6137 6137
- Misses 10614 10688 +74
- Partials 871 880 +9
Impacted Files | Coverage Δ | |
---|---|---|
contrib/drivers/huawei/oceanstor/client.go | 0% <0%> (ø) |
:arrow_up: |
contrib/drivers/huawei/oceanstor/oceanstor.go | 0% <0%> (ø) |
:arrow_up: |
pkg/dock/dock.go | 11.8% <0%> (-1.22%) |
:arrow_down: |
pkg/dock/discovery/discovery.go | 36.73% <0%> (+3.21%) |
:arrow_up: |
contrib/drivers/drivers.go | 23.52% <50%> (-1.48%) |
:arrow_down: |
pkg/controller/fileshare/filesharecontroller.go | 25% <0%> (-4.6%) |
:arrow_down: |
pkg/controller/volume/volumecontroller.go | 16.52% <0%> (-3.24%) |
:arrow_down: |
pkg/api/util/db.go | 35.7% <0%> (-1.29%) |
:arrow_down: |
osdsctl/cli/volume.go | 81.81% <0%> (-0.43%) |
:arrow_down: |
... and 14 more |