From 35a627df49ddff6a6067bb7100fc8973cbd0f0b8 Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Tue, 1 Dec 2020 08:37:06 -0500 Subject: [PATCH] adds the ability to read chunkFormatV3 while writing v2 (#2984) (cherry picked from commit a8af1c0c84a18192d0c3fb04dc1634cedc8fd078) --- pkg/chunkenc/memchunk.go | 2 +- pkg/chunkenc/memchunk_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/chunkenc/memchunk.go b/pkg/chunkenc/memchunk.go index 364797e2b301..999cddf29c9a 100644 --- a/pkg/chunkenc/memchunk.go +++ b/pkg/chunkenc/memchunk.go @@ -166,7 +166,7 @@ func NewMemChunk(enc Encoding, blockSize, targetSize int) *MemChunk { blocks: []block{}, head: &headBlock{}, - format: chunkFormatV3, + format: chunkFormatV2, encoding: enc, } diff --git a/pkg/chunkenc/memchunk_test.go b/pkg/chunkenc/memchunk_test.go index fa3f8e2b280e..b343a4d754b5 100644 --- a/pkg/chunkenc/memchunk_test.go +++ b/pkg/chunkenc/memchunk_test.go @@ -256,6 +256,7 @@ func TestRoundtripV3(t *testing.T) { for _, enc := range testEncoding { t.Run(enc.String(), func(t *testing.T) { c := NewMemChunk(enc, testBlockSize, testTargetSize) + c.format = chunkFormatV3 _ = fillChunk(c) b, err := c.Bytes()