cephfs: log clone progress

log cephfs clone progress report during cephfs clone
operation

Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
This commit is contained in:
Nikhil-Ladha
2024-10-28 11:39:13 +05:30
committed by mergify[bot]
parent 00d252e4ac
commit 98cf0780e1
4 changed files with 39 additions and 18 deletions

View File

@ -128,6 +128,17 @@ func CheckVolExists(ctx context.Context,
}
err = cloneState.ToError()
if errors.Is(err, cerrors.ErrCloneInProgress) {
progressReport := cloneState.GetProgressReport()
// append progress report only if the progress report parameters are present.
if progressReport.PercentageCloned != "" {
err = fmt.Errorf("%w. progress report: percentage cloned=%s, amount cloned=%s, files cloned=%s",
err,
progressReport.PercentageCloned,
progressReport.AmountCloned,
progressReport.FilesCloned)
log.ErrorLog(ctx, err.Error())
}
return nil, err
}
if errors.Is(err, cerrors.ErrClonePending) {