Skip to content

Commit

Permalink
fix panic in compactor when retention is not enabled (#3966)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepsukhani authored Jul 8, 2021
1 parent bee4567 commit ae3e499
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/storage/stores/shipper/compactor/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,17 @@ func (c *Compactor) RunCompaction(ctx context.Context) error {

defer func() {
c.metrics.compactTablesOperationTotal.WithLabelValues(status).Inc()
dmCallback := c.expirationChecker.MarkPhaseFailed
if status == statusSuccess {
dmCallback = c.expirationChecker.MarkPhaseFinished
c.metrics.compactTablesOperationDurationSeconds.Set(time.Since(start).Seconds())
c.metrics.compactTablesOperationLastSuccess.SetToCurrentTime()
}

if c.cfg.RetentionEnabled {
dmCallback()
if status == statusSuccess {
c.expirationChecker.MarkPhaseFinished()
} else {
c.expirationChecker.MarkPhaseFailed()
}
}
}()

Expand Down

0 comments on commit ae3e499

Please sign in to comment.