From bdc293abdd6fc6999e6b3e1bb4f969479578282f Mon Sep 17 00:00:00 2001
From: Edd Robinson <me@edd.io>
Date: Thu, 9 Aug 2018 19:20:56 +0100
Subject: [PATCH] Tidy up

---
 Godeps                   | 2 +-
 tsdb/index/tsi1/cache.go | 4 +++-
 tsdb/index/tsi1/index.go | 3 +--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Godeps b/Godeps
index 97235414a3..a3f14db56e 100644
--- a/Godeps
+++ b/Godeps
@@ -13,7 +13,7 @@ github.com/golang/protobuf b4deda0973fb4c70b50d226b1af49f3da59f5265
 github.com/golang/snappy d9eb7a3d35ec988b8585d4a0068e462c27d28380
 github.com/google/go-cmp 3af367b6b30c263d47e8895973edcca9a49cf029
 github.com/influxdata/influxql 5e999e6a81820d4450f2a1f35c5597b569258f01
-github.com/RoaringBitmap/roaring 4c23670306840b0f8755db247d2e9b8369fc356e
+github.com/influxdata/roaring fc520f41fab6dcece280e8d4853d87a09a67f9e0
 github.com/influxdata/usage-client 6d3895376368aa52a3a81d2a16e90f0f52371967
 github.com/jsternberg/zap-logfmt ac4bd917e18a4548ce6e0e765b29a4e7f397b0b6
 github.com/jwilder/encoding b4e1701a28efcc637d9afcca7d38e495fe909a09
diff --git a/tsdb/index/tsi1/cache.go b/tsdb/index/tsi1/cache.go
index 22a8d9d90e..2caa50ecfb 100644
--- a/tsdb/index/tsi1/cache.go
+++ b/tsdb/index/tsi1/cache.go
@@ -2,6 +2,7 @@ package tsi1
 
 import (
 	"container/list"
+	"fmt"
 	"sync"
 
 	"github.com/influxdata/influxdb/tsdb"
@@ -117,7 +118,8 @@ func (c *TagValueSeriesIDCache) Put(name, key, value []byte, ss *tsdb.SeriesIDSe
 		if tkmap, ok := mmap[string(key)]; ok {
 			if _, ok := tkmap[string(value)]; ok {
 				// FIXME(edd): only here whilst testing.
-				panic("existence of cache item breaks invariant")
+				fmt.Println("existence of cache item breaks invariant")
+				goto EVICT
 			}
 
 			// Add the set to the map
diff --git a/tsdb/index/tsi1/index.go b/tsdb/index/tsi1/index.go
index b6fd743d0b..6002dda357 100644
--- a/tsdb/index/tsi1/index.go
+++ b/tsdb/index/tsi1/index.go
@@ -42,6 +42,7 @@ func init() {
 		DefaultPartitionN = uint64(i)
 	}
 
+	// TODO(edd): To remove when feature finalised.
 	var err error
 	if os.Getenv("INFLUXDB_EXP_TSI_CACHING") != "" {
 		EnableBitsetCache, err = strconv.ParseBool(os.Getenv("INFLUXDB_EXP_TSI_CACHING"))
@@ -997,8 +998,6 @@ func (i *Index) TagValueSeriesIDIterator(name, key, value []byte) (tsdb.SeriesID
 		ss := ssitr.SeriesIDSet()
 		ss.SetCOW(true) // This is important to speed the clone up.
 		i.tagValueCache.Put(name, key, value, ss)
-	} else {
-		fmt.Printf("UNABLE TO PUT %T for %q %q %q\n", itr, name, key, value)
 	}
 	return itr, nil
 }