Skip to content

Commit

Permalink
Merge pull request #14246 from influxdata/mu-tsm-clean-14058
Browse files Browse the repository at this point in the history
Clears tsm files when replace fails
  • Loading branch information
maxunt authored Aug 7, 2019
2 parents 757fb4f + fe2aceb commit 62d1474
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tsdb/tsm1/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 62d1474

Please sign in to comment.