lib/storage: set bsm.Block to nil on error, so the previous block couldn't be used.

This may help nailing down the issue https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2082
This commit is contained in:
Aliaksandr Valialkin 2022-01-20 20:11:56 +02:00
parent 9797c928ef
commit ea87f21e23
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -88,12 +88,14 @@ func (bsm *blockStreamMerger) nextBlock() error {
}
if err := bsrMin.Error(); err != nil {
bsm.Block = nil
return err
}
heap.Pop(&bsm.bsrHeap)
if len(bsm.bsrHeap) == 0 {
bsm.Block = nil
return io.EOF
}