From 2f82d9a5255d363f05ed8a1eac82da6e252c4084 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Tue, 5 Jul 2016 12:12:21 -0500 Subject: [PATCH] Truncate the slice when merging the caches --- CHANGELOG.md | 3 ++- tsdb/engine/tsm1/cache.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77bafc56d12..3fe4b6b468a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,7 +79,8 @@ With this release the systemd configuration files for InfluxDB will use the syst - [#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 - [#6911](https://github.com/influxdata/influxdb/issues/6911): Fix fill(previous) when used with math operators. -- [#6934](https://github.com/influxdata/influxdb/issues/6934): Fix regex binary encoding for a measurement. +- [#6934](https://github.com/influxdata/influxdb/pull/6934): Fix regex binary encoding for a measurement. +- [#6942](https://github.com/influxdata/influxdb/pull/6942): Fix panic: truncate the slice when merging the caches. ## v0.13.0 [2016-05-12] diff --git a/tsdb/engine/tsm1/cache.go b/tsdb/engine/tsm1/cache.go index 392952d069f..178a8010428 100644 --- a/tsdb/engine/tsm1/cache.go +++ b/tsdb/engine/tsm1/cache.go @@ -419,6 +419,7 @@ func (c *Cache) merged(key string) Values { n += copy(values[n:], e.values) e.mu.RUnlock() } + values = values[:n] if needSort { values = values.Deduplicate()