From cbb10fd84deda1e0eb217675a3704ae925eadb64 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 10 Mar 2021 11:04:45 +0530 Subject: [PATCH] rbd: add more logging for NodeUnstageVolume For NodeUnstageVolume its a two step process, first unmount the volume and than unmap the volume. Currently, we are logging only after rbd unmapping is done. sometimes it becomes difficult to debug with above logging whether more time is spent in unmount or unmap. This commits adds one more debug log after unmount is done. with this we can identify where exactly more time is spent by looking at the logs. Signed-off-by: Madhu Rajanna --- internal/rbd/nodeserver.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 3e6c30a0d..a4430f08a 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -649,6 +649,8 @@ func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag util.ExtendedLog(ctx, "failed to unmount targetPath: %s with error: %v", stagingTargetPath, err) return nil, status.Error(codes.Internal, err.Error()) } + util.DebugLog(ctx, "successfully unmounted volume (%s) from staging path (%s)", + req.GetVolumeId(), stagingTargetPath) } if err = os.Remove(stagingTargetPath); err != nil { @@ -687,8 +689,7 @@ func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag return nil, status.Error(codes.Internal, err.Error()) } - util.DebugLog(ctx, "successfully unmounted volume (%s) from staging path (%s)", - req.GetVolumeId(), stagingTargetPath) + util.DebugLog(ctx, "successfully unmapped volume (%s)", req.GetVolumeId()) if err = cleanupRBDImageMetadataStash(stagingParentPath); err != nil { util.ErrorLog(ctx, "failed to cleanup image metadata stash (%v)", err)