diff --git a/tsdb/tsm1/engine.go b/tsdb/tsm1/engine.go index 875b805afe0..59c30981210 100644 --- a/tsdb/tsm1/engine.go +++ b/tsdb/tsm1/engine.go @@ -1185,6 +1185,14 @@ func (s *compactionStrategy) compactGroup(ctx context.Context) { log.Info("Error replacing new TSM files", zap.Error(err)) s.tracker.Attempted(s.level, false, "", 0) time.Sleep(time.Second) + + // Remove the new snapshot files. We will try again. + for _, file := range files { + if err := os.Remove(file); err != nil { + log.Error("Unable to remove file", zap.String("path", file), zap.Error(err)) + } + } + return }