Skip to content

Commit

Permalink
compact: retry on sync metas error
Browse files Browse the repository at this point in the history
As SyncMetas is surrounded by Repeat func and can return retry errors, in some cases (like S3) errors (network issue, timeout, etc.) can be retried.

Signed-off-by: Seena Fallah <[email protected]>
  • Loading branch information
clwluvw committed Nov 5, 2022
1 parent ef3a331 commit 450d29d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/thanos/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,15 @@ func runCompact(
return runutil.Repeat(conf.progressCalculateInterval, ctx.Done(), func() error {

if err := sy.SyncMetas(ctx); err != nil {
// The RetryError signals that we hit an retriable error (transient error, no connection).
// You should alert on this being triggered too frequently.
if compact.IsRetryError(err) {
level.Error(logger).Log("msg", "retriable error", "err", err)
compactMetrics.retried.Inc()

return nil
}

return errors.Wrapf(err, "could not sync metas")
}

Expand Down

0 comments on commit 450d29d

Please sign in to comment.