container-storage-interface/spec

CreateVolume with snapshot volume source races with DeleteSnapshot

gman0 opened this issue · 1 comments

gman0 commented

DeleteSnapshot may be called while that snapshot is in use as a volume source in a concurrent CreateVolume call, creating a race condition.

COs should be instructed how to deal with various situations when these two calls interact. Specifically, CO must block all CreateVolume calls with a snapshot volume source while that snapshot is being deleted, and vice versa - it must block all DeleteSnapshot calls while that snapshot is being used as a volume source in a CreateVolume call.

Is this something that belongs to the CSI spec? The snapshot controller in Kubernetes already does this, and attempting to delete such snapshots defers their deletion until the CreateVolume call(s) in question finish processing the request. I think it would be best to make this (or similar) behavior official by having it stated explicitly in the spec.

jdef commented