From fdf0bac71712dd1f92fbbda4766f9482e31ced44 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Mon, 27 Jun 2016 18:45:08 -0600 Subject: [PATCH] Fix panic: runtime error: index out of range Fixes #6829 --- CHANGELOG.md | 1 + tsdb/engine/tsm1/cache.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c8b0b71c6..79d7eb328a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ With this release the systemd configuration files for InfluxDB will use the syst - [#6864](https://github.com/influxdata/influxdb/pull/6864): Allow a non-admin to call "use" for the influx cli. - [#6855](https://github.com/influxdata/influxdb/pull/6855): Update `stress/v2` to work with clusters, ssl, and username/password auth. Code cleanup - [#6738](https://github.com/influxdata/influxdb/issues/6738): Time sorting broken with overwritten points +- [#6829](https://github.com/influxdata/influxdb/issues/6829): Fix panic: runtime error: index out of range ## v0.13.0 [2016-05-12] diff --git a/tsdb/engine/tsm1/cache.go b/tsdb/engine/tsm1/cache.go index 823cefaa59..392952d069 100644 --- a/tsdb/engine/tsm1/cache.go +++ b/tsdb/engine/tsm1/cache.go @@ -413,7 +413,7 @@ func (c *Cache) merged(key string) Values { n := 0 for _, e := range entries { e.mu.RLock() - if !needSort && n > 0 { + if !needSort && n > 0 && len(e.values) > 0 { needSort = values[n-1].UnixNano() >= e.values[0].UnixNano() } n += copy(values[n:], e.values)