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

Fix TSI non-contiguous compaction panic. #8468

Conversation

benbjohnson
Copy link
Contributor

@benbjohnson benbjohnson commented Jun 8, 2017

Overview

This fixes the case where log files are compacted out of order and cause non-contiguous sets of index files to be compacted.

Previously, the compaction planner would fetch a list of index files for each level and compact them in order starting with the oldest ones. This can be a problem for level 1 because level 0 (log files) are compacted individually and in some cases a log file can finish compacting before older log files are finished compacting. This causes there to be a gap in the list of level 1 files that is ignored when fetching a list of index files.

Now, the planner reads the list of index files starting from the oldest but stops once it hits a log file. This prevents that gap from being ignored.

Fixes #8459.

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

Copy link
Contributor

@e-dard e-dard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@benbjohnson benbjohnson force-pushed the 8459-fix-tsi-non-contiguous-compaction branch 2 times, most recently from 64fa20d to 7a53a5c Compare June 12, 2017 16:28
This fixes the case where log files are compacted out of order
and cause non-contiguous sets of index files to be compacted.

Previously, the compaction planner would fetch a list of index files
for each level and compact them in order starting with the oldest
ones. This can be a problem for level 1 because level 0 (log files)
are compacted individually and in some cases a log file can finish
compacting before older log files are finished compacting. This
causes there to be a gap in the list of level 1 files that is
ignored when fetching a list of index files.

Now, the planner reads the list of index files starting from the
oldest but stops once it hits a log file. This prevents that gap
from being ignored.
@benbjohnson benbjohnson force-pushed the 8459-fix-tsi-non-contiguous-compaction branch from 7a53a5c to b51f604 Compare June 13, 2017 16:53
@benbjohnson benbjohnson merged commit 2c30f28 into influxdata:master Jun 13, 2017
@benbjohnson benbjohnson deleted the 8459-fix-tsi-non-contiguous-compaction branch June 13, 2017 16:53
@benbjohnson benbjohnson mentioned this pull request Jun 13, 2017
3 tasks
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.

panic: cannot replace non-contiguous files
2 participants