From 2daf2f9f0c6ba1bb28d0ae2977dcd062724afa7f Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 11 Jan 2022 12:44:22 +0530 Subject: [PATCH] cephfs: log error message if clone fails During CreateVolume from snapshot/volume, its difficult to identify if the clone is failed and a new clone is created. In case of clone failure logging the error message for better debugging. Signed-off-by: Madhu Rajanna --- internal/cephfs/core/fsjournal.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/cephfs/core/fsjournal.go b/internal/cephfs/core/fsjournal.go index b9d57e8c2..f22b7b9a8 100644 --- a/internal/cephfs/core/fsjournal.go +++ b/internal/cephfs/core/fsjournal.go @@ -124,6 +124,11 @@ func CheckVolExists(ctx context.Context, return nil, cerrors.ErrClonePending } if cloneState == cephFSCloneFailed { + log.ErrorLog(ctx, + "clone failed, deleting subvolume clone. vol=%s, subvol=%s subvolgroup=%s", + volOptions.FsName, + vid.FsSubvolName, + volOptions.SubvolumeGroup) err = volOptions.PurgeVolume(ctx, fsutil.VolumeID(vid.FsSubvolName), true) if err != nil { log.ErrorLog(ctx, "failed to delete volume %s: %v", vid.FsSubvolName, err)