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

Ensure tmp files cleaned up when compaction disabled #8562

Merged
merged 2 commits into from
Jul 5, 2017

Conversation

e-dard
Copy link
Contributor

@e-dard e-dard commented Jul 4, 2017

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

Fix for #8559.

#8559 occurs most commonly in testing when compactions that are in-progress are interrupted by the removal of data. DROP MEASUREMENT tends to trigger the issue. The interruption leaves .tsm.tmp files within shard directories.

Whilst we do have compaction logic to deal with interruptions, the current logic works by attempting to create .tsm.tmp files and, when that fails due to the file already existing, assume that another compaction is in progress. The latter compaction then bails out and complains that a .tsm.tmp file already exists (really it's assuming that another compaction goroutine is currently taking care of the compaction).

In two specific points in the compaction logic it's possible to trigger the situation where the .tsm.tmp files are left around but other compaction goroutines should not treat this as an on-going compaction. In these cases we remove the tsm.tmp files.

@e-dard e-dard force-pushed the er-8559-compaction-stuck branch from a9fb466 to 101af89 Compare July 5, 2017 16:15
@e-dard e-dard changed the title [WIP] Ensure tmp files cleaned up when compaction disabled Ensure tmp files cleaned up when compaction disabled Jul 5, 2017
@e-dard e-dard merged commit 36bdd83 into master Jul 5, 2017
@e-dard e-dard deleted the er-8559-compaction-stuck branch July 5, 2017 20:52
@e-dard e-dard removed the review label Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants