Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary TSM files not cleaned up when compaction rename fails #14058

Closed
stuartcarnie opened this issue Jun 4, 2019 · 0 comments · Fixed by #14246
Closed

Temporary TSM files not cleaned up when compaction rename fails #14058

stuartcarnie opened this issue Jun 4, 2019 · 0 comments · Fixed by #14246
Assignees
Milestone

Comments

@stuartcarnie
Copy link
Contributor

stuartcarnie commented Jun 4, 2019

As a result of analyzing #11339, it was determined there is an issue with the final stage of compaction during the exchange of old with new TSM files. Specifically, if an error occurs during the FileStore.replace call, which is called indirectly via ReplaceWithCallback in the compactGroup API:

if err := s.fileStore.ReplaceWithCallback(group, files, nil); err != nil {
log.Info("Error replacing new TSM files", zap.Error(err))
atomic.AddInt64(s.errorStat, 1)
time.Sleep(time.Second)
return
}

Note that the error is simply logged.

Alternatively, when a level-0 (cache snapshot) is written and Replace fails, the temporary files are cleaned up:

log.Info("Error adding new TSM files from snapshot. Removing temp files.", zap.Error(err))
// Remove the new snapshot files. We will try again.
for _, file := range newFiles {
if err := os.Remove(file); err != nil {
log.Info("Unable to remove file", zap.String("path", file), zap.Error(err))
}
}
return err

Per #11339, FileStore.replace failed because the server was low on memory and was unable to mmap the new TSM files.

@stuartcarnie stuartcarnie changed the title Temporary TSM files not cleaned up when compaction fails Temporary TSM files not cleaned up when compaction rename fails Jun 4, 2019
@e-dard e-dard added this to the 1.7.8 milestone Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants