From 510dc17066fef873342ccecfe095e03d8d29524b Mon Sep 17 00:00:00 2001 From: Shubheksha Jalan Date: Thu, 11 Jan 2018 01:03:20 +0530 Subject: [PATCH] fix tests, set version when initializing the index writer --- block_test.go | 2 +- index/index.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/block_test.go b/block_test.go index 690cd07ad1..4ebb9685d0 100644 --- a/block_test.go +++ b/block_test.go @@ -42,7 +42,7 @@ func TestSetCompactionFailed(t *testing.T) { func createEmptyBlock(t *testing.T, dir string) *Block { testutil.Ok(t, os.MkdirAll(dir, 0777)) - testutil.Ok(t, writeMetaFile(dir, &BlockMeta{})) + testutil.Ok(t, writeMetaFile(dir, &BlockMeta{Version: 2})) ir, err := index.NewWriter(filepath.Join(dir, indexFilename)) testutil.Ok(t, err) diff --git a/index/index.go b/index/index.go index 3b7a09c39f..7decaa5176 100644 --- a/index/index.go +++ b/index/index.go @@ -168,6 +168,8 @@ func NewWriter(fn string) (*Writer, error) { symbols: make(map[string]uint32, 1<<13), seriesOffsets: make(map[uint64]uint64, 1<<16), crc32: newCRC32(), + + Version: 2, } if err := iw.writeMeta(); err != nil { return nil, err