Skip to content

Commit

Permalink
Don't acknowledge CSI detachment until volume becomes unavailable on …
Browse files Browse the repository at this point in the history
…node

Longhorn 3401

Signed-off-by: Eric Weber <eric.weber@suse.com>
  • Loading branch information
ejweber committed Jun 19, 2024
1 parent ed96763 commit fff650e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion csi/controller_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,12 @@ func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *

return cs.unpublishVolume(volume, nodeID, attachmentID, func() error {
checkVolumeUnpublished := func(vol *longhornclient.Volume) bool {
isRegularRWXVolume := vol.AccessMode == string(longhorn.AccessModeReadWriteMany) && !vol.Migratable
_, ok := vol.VolumeAttachment.Attachments[attachmentID]
return !ok
if isRegularRWXVolume {
return !ok
}
return !ok && !isVolumeAvailableOn(vol, nodeID)
}

if !cs.waitForVolumeState(volumeID, "volume unpublished", checkVolumeUnpublished, false, true) {
Expand Down

0 comments on commit fff650e

Please sign in to comment.