mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
Fix panic on nil index writer
This commit is contained in:
parent
467948f3c3
commit
5d47710f8a
|
@ -428,10 +428,10 @@ func (c *LeveledCompactor) write(dest string, meta *BlockMeta, blocks ...BlockRe
|
||||||
}
|
}
|
||||||
|
|
||||||
indexw, err := index.NewWriter(filepath.Join(tmp, indexFilename))
|
indexw, err := index.NewWriter(filepath.Join(tmp, indexFilename))
|
||||||
meta.Version = indexw.Version
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "open index writer")
|
return errors.Wrap(err, "open index writer")
|
||||||
}
|
}
|
||||||
|
meta.Version = indexw.Version
|
||||||
|
|
||||||
if err := c.populateBlock(blocks, meta, indexw, chunkw); err != nil {
|
if err := c.populateBlock(blocks, meta, indexw, chunkw); err != nil {
|
||||||
return errors.Wrap(err, "write compaction")
|
return errors.Wrap(err, "write compaction")
|
||||||
|
|
Loading…
Reference in a new issue