Skip to content

Commit

Permalink
Fixes iota unexpected behaviour with bytes for chunk encoding. (#2945)
Browse files Browse the repository at this point in the history
* 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 <cyril.tovena@gmail.com>

* With iota correclty this time.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
(cherry picked from commit fa7ea9c)
  • Loading branch information
cyriltovena authored and slim-bean committed Dec 10, 2020
1 parent 8cd276d commit fbf1790
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/chunkenc/memchunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (
)

const (
blocksPerChunk = 10
maxLineLength = 1024 * 1024 * 1024

_ byte = iota
chunkFormatV1
chunkFormatV2
chunkFormatV3

blocksPerChunk = 10
maxLineLength = 1024 * 1024 * 1024
)

var (
Expand Down

0 comments on commit fbf1790

Please sign in to comment.