Merge pull request #265 from simonpasquier/fix-nil-index-writer

Fix panic on nil index writer
This commit is contained in:
Goutham Veeramachaneni 2018-01-24 20:28:35 +05:30 committed by GitHub
commit ad0fdaf436
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -428,10 +428,10 @@ func (c *LeveledCompactor) write(dest string, meta *BlockMeta, blocks ...BlockRe
}
indexw, err := index.NewWriter(filepath.Join(tmp, indexFilename))
meta.Version = indexw.Version
if err != nil {
return errors.Wrap(err, "open index writer")
}
meta.Version = indexw.Version
if err := c.populateBlock(blocks, meta, indexw, chunkw); err != nil {
return errors.Wrap(err, "write compaction")