diff --git a/.travis.yml b/.travis.yml index 568f7c24f..bbe4af716 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ sudo: required services: docker go: -- 1.10.4 +- 1.10.7 notifications: on_success: never @@ -23,7 +23,7 @@ env: matrix: fast_finish: true allow_failures: - - go: 1.10.4 + - go: 1.10.7 env: TARGET=linux-386-unit exclude: - go: tip diff --git a/proxy/grpcproxy/cache/store.go b/proxy/grpcproxy/cache/store.go index 70715e499..5765228e5 100644 --- a/proxy/grpcproxy/cache/store.go +++ b/proxy/grpcproxy/cache/store.go @@ -99,9 +99,12 @@ func (c *cache) Add(req *pb.RangeRequest, resp *pb.RangeResponse) { iv = c.cachedRanges.Find(ivl) if iv == nil { - c.cachedRanges.Insert(ivl, []string{key}) + val := map[string]struct{}{key: {}} + c.cachedRanges.Insert(ivl, val) } else { - iv.Val = append(iv.Val.([]string), key) + val := iv.Val.(map[string]struct{}) + val[key] = struct{}{} + iv.Val = val } } @@ -141,8 +144,8 @@ func (c *cache) Invalidate(key, endkey []byte) { ivs = c.cachedRanges.Stab(ivl) for _, iv := range ivs { - keys := iv.Val.([]string) - for _, key := range keys { + keys := iv.Val.(map[string]struct{}) + for key := range keys { c.lru.Remove(key) } }