fix tests, set version when initializing the index writer

This commit is contained in:
Shubheksha Jalan 2018-01-11 01:03:20 +05:30
parent 44052bc937
commit 510dc17066
2 changed files with 3 additions and 1 deletions

View file

@ -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)

View file

@ -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