From fbf17904f7b3c047fe69c07829e1411c6f2d36b0 Mon Sep 17 00:00:00 2001 From: Cyril Tovena Date: Wed, 18 Nov 2020 03:40:50 -0500 Subject: [PATCH] Fixes iota unexpected behaviour with bytes for chunk encoding. (#2945) * Fixes iota unexpected behaviour with bytes for chunk encoding. This was introducing incompatibilities since iota with bytes starts at 2. Seems like a weird conversion between iota int and byte. This can currenlty corrupt chunks, and previous chunks are not decodable. Signed-off-by: Cyril Tovena * With iota correclty this time. Signed-off-by: Cyril Tovena (cherry picked from commit fa7ea9cc2d8bf5fa59c75b6a36236802c5650ac7) --- pkg/chunkenc/memchunk.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/chunkenc/memchunk.go b/pkg/chunkenc/memchunk.go index 5a74393616c6..364797e2b301 100644 --- a/pkg/chunkenc/memchunk.go +++ b/pkg/chunkenc/memchunk.go @@ -25,13 +25,13 @@ import ( ) const ( - blocksPerChunk = 10 - maxLineLength = 1024 * 1024 * 1024 - _ byte = iota chunkFormatV1 chunkFormatV2 chunkFormatV3 + + blocksPerChunk = 10 + maxLineLength = 1024 * 1024 * 1024 ) var (