From c42d4768caae78748f0254ea2255bc70884ab4e2 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Tue, 20 Jul 2021 13:16:33 +0530 Subject: [PATCH] util: remove the deleteLock acquistion check for clone and snapshot At present while acquiring the deleteLock on the volume, we check for ongoing clone and snapshot creation operations on the same. Considering snapshot and clone controllers does not allow parent volume deletion on subjected operations, we can be free from this extra check. Signed-off-by: Humble Chirammal --- internal/util/idlocker.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/internal/util/idlocker.go b/internal/util/idlocker.go index 03681d670..165c44263 100644 --- a/internal/util/idlocker.go +++ b/internal/util/idlocker.go @@ -130,20 +130,11 @@ func (ol *OperationLock) tryAcquire(op operation, volumeID string) error { val := ol.locks[cloneOpt][volumeID] ol.locks[cloneOpt][volumeID] = val + 1 case deleteOp: - // / During delete operation the volume should not be under expand, - // clone or snapshot operation. + // During delete operation the volume should not be under expand, // check any expand operation is going on for given volume ID if _, ok := ol.locks[expandOp][volumeID]; ok { return fmt.Errorf("an Expand operation with given id %s already exists", volumeID) } - // check any clone operation is going on for given volume ID - if _, ok := ol.locks[cloneOpt][volumeID]; ok { - return fmt.Errorf("a Clone operation with given id %s already exists", volumeID) - } - // check any delete operation is going on for given volume ID - if _, ok := ol.locks[createOp][volumeID]; ok { - return fmt.Errorf("a Create operation with given id %s already exists", volumeID) - } // check any restore operation is going on for given volume ID if _, ok := ol.locks[restoreOp][volumeID]; ok { return fmt.Errorf("a Restore operation with given id %s already exists", volumeID)