describe-backup: ignore missed file for running backup
@@ -282,16 +282,20 @@ func describeBackup(cn *pbm.PBM, b *descBcp) (fmt.Stringer, error) {
}
if bcp.Size == 0 {
+ switch bcp.Status {
+ case pbm.StatusDone, pbm.StatusCancelled, pbm.StatusError:
stg, err := cn.GetStorage(cn.Logger().NewEvent("", "", "", primitive.Timestamp{}))
if err != nil {
return nil, errors.WithMessage(err, "get storage")
}
rv.Size, err = getLegacySnapshotSize(bcp, stg)
- if err != nil {
+ if errors.Is(err, errMissedFile) && bcp.Status != pbm.StatusDone {
+ // canceled/failed backup can be incomplete. ignore
return nil, errors.WithMessage(err, "get snapshot size")
}
}
+ }
rv.Replsets = make([]bcpReplDesc, len(bcp.Replsets))
for i, r := range bcp.Replsets {
