api icon indicating copy to clipboard operation
api copied to clipboard

[Driver] Enhancement for concurrency

Open sushanthakumar opened this issue 4 years ago • 4 comments

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:

sushanthakumar avatar Jan 22 '20 02:01 sushanthakumar

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...

kumarashit avatar Jan 22 '20 12:01 kumarashit

Can you please check CI issues

kumarashit avatar Feb 04 '20 08:02 kumarashit

@sushanthakumar Please check the CI issue

kumarashit avatar Feb 05 '20 04:02 kumarashit

Codecov Report

Merging #1195 into development will decrease coverage by 0.16%. The diff coverage is 3.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

codecov[bot] avatar Feb 06 '20 05:02 codecov[bot]