thanos-io/thanos · error
could not calculate downsampling progress
Error message
could not calculate downsampling progress
What it means
ds.ProgressCalculate(ctx, groups) computes downsampling progress metrics via the DownsampleProgressCalculator. Failure is wrapped as 'could not calculate downsampling progress'. This only affects progress metrics; downsampling itself happens in the main compaction loop.
Solutions
- If inner error is 'context canceled', treat as benign shutdown noise; no action needed.
- Inspect the wrapped error's group and validate blocks via 'thanos tools bucket inspect'.
- Fix any duplicate/overlapping blocks first (upstream grouping failures corrupt state).
- Upgrade Thanos if the calculator fails on valid metadata.
Example fix
null
Defensive patterns
Strategy: try-catch
Try / catch
if err := ds.ProgressCalculate(ctx, groups); err != nil {
if errors.Is(err, context.Canceled) || ctx.Err() != nil {
return nil // shutdown noise
}
log.Errorf("could not calculate downsampling progress: %v", err)
return nil
} Prevention
- Treat context-canceled as benign in progress loops.
- Resolve duplicate-block issues before diagnosing calculator errors.
- Alert on repeated non-cancel failures rather than crashing the worker.
- Keep Thanos current — downsampling calculator bugs are fixed across releases.
When it happens
Trigger: The downsampling progress calculator errors on the provided groups — usually ctx cancellation during shutdown, or inconsistent group state from overlapping blocks.
Common situations: 'context canceled' errors during compactor termination while the progress tick runs; also rare planner errors on unusual block layouts (e.g. only 5m-resolution blocks present).
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- raw resolution must be higher than the minimum block size…
- 5m resolution retention must be higher than the minimum…
- sync before first pass of downsampling
- first pass of downsampling failed
- sync before second pass of downsampling
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/60c0c1e0bea0c738.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/thanos/compact.go:688
return errors.Wrapf(err, "could not calculate compaction progress")
}
retGroups, err := grouper.Groups(metas)
if err != nil {
return errors.Wrapf(err, "could not group metadata for retention")
}
if err = rs.ProgressCalculate(ctx, retGroups); err != nil {
return errors.Wrapf(err, "could not calculate retention progress")
}
if !conf.disableDownsampling {
groups, err = grouper.Groups(metas)
if err != nil {
return errors.Wrapf(err, "could not group metadata into downsample groups")
}
if err := ds.ProgressCalculate(ctx, groups); err != nil {
return errors.Wrapf(err, "could not calculate downsampling progress")
}
}
return nil
})
}, func(err error) {
cancel()
})
}
}
level.Info(logger).Log("msg", "starting compact node")
statusProber.Ready()
return nil
}
type compactConfig struct {
haltOnError boolView on GitHub (pinned to 35b8b99117)