log all recoverable errors in backup/restore (#2598)

## Description

fault is aggregating recoverable errors, but no code currently reports them.  This is a quick hack to add logging around those errors.  In the future, we'll want to refine who and where performs this report.

## Does this PR need a docs update or release note?

- [x]  No 

## Type of change

- [x] 🧹 Tech Debt/Cleanup

## Issue(s)

* #1970

## Test Plan

- [x] 💪 Manual
This commit is contained in:
Keepers 2023-02-21 13:57:30 -07:00 committed by GitHub
parent d7c0f61105
commit a88b984b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -169,6 +169,15 @@ func (op *BackupOperation) Run(ctx context.Context) (err error) {
opStats.readErr = op.Errors.Err()
}
// TODO: the consumer (sdk or cli) should run this, not operations.
recoverableCount := len(op.Errors.Errs())
for i, err := range op.Errors.Errs() {
logger.Ctx(ctx).
With("error", err).
With(clues.InErr(err).Slice()...).
Errorf("doing backup: recoverable error %d of %d", i+1, recoverableCount)
}
// -----
// Persistence
// -----

View File

@ -156,6 +156,15 @@ func (op *RestoreOperation) Run(ctx context.Context) (restoreDetails *details.De
opStats.readErr = op.Errors.Err()
}
// TODO: the consumer (sdk or cli) should run this, not operations.
recoverableCount := len(op.Errors.Errs())
for i, err := range op.Errors.Errs() {
logger.Ctx(ctx).
With("error", err).
With(clues.InErr(err).Slice()...).
Errorf("doing restore: recoverable error %d of %d", i+1, recoverableCount)
}
// -----
// Persistence
// -----