mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
util: remove deleteLock check while acquiring snapshot createLock
snapshot controller make sure the pvc which is the source for the snapshot request wont get deleted while snapshot is getting created, so we dont need to check for any ongoing delete operation here on the volume. Subjected code path in snapshot controller: ``` pvc, err := ctrl.getClaimFromVolumeSnapshot(snapshot) . .. pvcClone.ObjectMeta.Finalizers = append(pvcClone.ObjectMeta.Finalizers, utils.PVCFinalizer) _, err = ctrl.client.CoreV1().PersistentVolumeClaims(pvcClone.Namespace).Update(..) ``` Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
10fc639d68
commit
bd947bbe31
@ -108,13 +108,10 @@ func (ol *OperationLock) tryAcquire(op operation, volumeID string) error {
|
|||||||
defer ol.mux.Unlock()
|
defer ol.mux.Unlock()
|
||||||
switch op {
|
switch op {
|
||||||
case createOp:
|
case createOp:
|
||||||
// During snapshot create operation there should not be any delete
|
// snapshot controller make sure the pvc which is the source for the
|
||||||
// operation going on for the volume.
|
// snapshot request won't get deleted while snapshot is getting created,
|
||||||
|
// so we dont need to check for any ongoing delete operation here on the
|
||||||
// check any delete operation is going on for given volume ID
|
// volume.
|
||||||
if _, ok := ol.locks[deleteOp][volumeID]; ok {
|
|
||||||
return fmt.Errorf("a Delete operation with given id %s already exists", volumeID)
|
|
||||||
}
|
|
||||||
// increment the counter for snapshot create operation
|
// increment the counter for snapshot create operation
|
||||||
val := ol.locks[createOp][volumeID]
|
val := ol.locks[createOp][volumeID]
|
||||||
ol.locks[createOp][volumeID] = val + 1
|
ol.locks[createOp][volumeID] = val + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user