From 3df396e6f1cb86365f4ae914e9d08d7869fddf61 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 26 Mar 2024 15:38:20 +0100 Subject: [PATCH] rbd: add extra logging while cleaning up snapshots Signed-off-by: Niels de Vos --- internal/rbd/controllerserver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index 01d4b6c583b..4f07ce5f0d3 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -1450,12 +1450,16 @@ func (cs *ControllerServer) DeleteSnapshot( // or partially complete (snap and snapOMap are garbage collected already), hence return // success as deletion is complete if errors.Is(err, util.ErrKeyNotFound) { + log.UsefulLog(ctx, "snapshot %s was been deleted already: %v", snapshotID, err) + return &csi.DeleteSnapshotResponse{}, nil } // if the error is ErrImageNotFound, We need to cleanup the image from // trash and remove the metadata in OMAP. if errors.Is(err, ErrImageNotFound) { + log.UsefulLog(ctx, "cleaning up leftovers of snapshot %s: %v", snapshotID, err) + err = cleanUpImageAndSnapReservation(ctx, rbdSnap, cr) if err != nil { return nil, status.Error(codes.Internal, err.Error())