Prevent concurrent DeleteVolume/DeleteSnapshot during CreateVolume - #6322
Prevent concurrent DeleteVolume/DeleteSnapshot during CreateVolume #6322nixpanic wants to merge 2 commits into
Conversation
231b980 to
f63a16c
Compare
black-dragon74
left a comment
There was a problem hiding this comment.
GH is still processing the updates
f63a16c to
cfc44cd
Compare
Pull request has been modified.
|
@Mergifyio rebase |
🛑 The pull request rule doesn't match anymoreDetailsThis action has been cancelled. |
cfc44cd to
5920d02
Compare
|
@Mergifyio queue |
Merge Queue Status
Waiting for
All conditions
|
|
@Mergifyio rebase |
🛑 The pull request rule doesn't match anymoreDetailsThis action has been cancelled. |
When creating a volume from a source (either cloning from a volume or restoring from a snapshot), acquire locks on the source to prevent concurrent operations that could interfere with the clone/restore process. This prevents race conditions where the source volume or snapshot could be modified or deleted while being used as a source for creating a new volume. Assisted-by: AskBob <askbob@ibm.com> Signed-off-by: Niels de Vos <ndevos@ibm.com>
When creating a volume from a source (either cloning from a volume or restoring from a snapshot), acquire locks on the source to prevent concurrent operations that could interfere with the clone/restore process. This prevents race conditions where the source volume or snapshot could be modified or deleted while being used as a source for creating a new volume. Assisted-by: AskBob <askbob@ibm.com> Signed-off-by: Niels de Vos <ndevos@ibm.com>
5920d02 to
8907b93
Compare
|
Note that #6277 is already running CI jobs. |
Rakshith-R
left a comment
There was a problem hiding this comment.
Doesn't this also block concurrent create ops on same parent ?
and therefore slow create op.
ext-provisioner and ext-snapshotter are responsible for adding finalizer on source pvc/snap.
Delete should get blocked since the pvc is still mounted. |
Describe what this PR does
There is a race condition possible when
CreateVolumeuses a source volume/snapshot and the source is deleted at the same time. The creation of the volume may fail in weird ways. By grabbing a lock for the source volume/snapshot, a concurrentDeleteVolumeprocedure has to wait until theCreateVolumeprocedure has finished.Related issues
Fixes: #6321
Note: NFS does not use the source volume/snapshot in any way, it forwards the
CreateVolumecall on to the CephFS Controller. There is no need for the added locking in NFS. NVMe-oF only gets the Clone/Restore functionality through the work-in-progress #6277.Show available bot commands
These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:
/retest ci/centos/<job-name>: retest the<job-name>after unrelatedfailure (please report the failure too!)