diff --git a/CHANGELOG.md b/CHANGELOG.md index beea5e5984..83055093a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,7 +87,7 @@ The following new configuration options are available. - [#7957](https://github.com/influxdata/influxdb/issues/7957): URL query parameter credentials take priority over Authentication header. - [#8443](https://github.com/influxdata/influxdb/issues/8443): TSI branch has duplicate tag values. - [#8299](https://github.com/influxdata/influxdb/issues/8299): Out of memory when using HTTP API - +- [#8455](https://github.com/influxdata/influxdb/pull/8455): Check file count before attempting a TSI level compaction. ## v1.2.4 [2017-05-08] diff --git a/tsdb/index/tsi1/index.go b/tsdb/index/tsi1/index.go index 99cc994a73..0ca8c9ac03 100644 --- a/tsdb/index/tsi1/index.go +++ b/tsdb/index/tsi1/index.go @@ -805,7 +805,11 @@ func (i *Index) compact() { } // Collect files for the level. + // Skip if we don't have enough files in the level. files := fs.IndexFilesByLevel(level) + if len(files) < 2 { + continue + } // Calculate total size. Skip level if it doesn't meet min size of next level. var size int64