mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
lib/mergeset: fill partHeader.firstItem on first block flush
This commit is contained in:
parent
c05885fb5f
commit
410f993bf6
@ -95,11 +95,6 @@ again:
|
||||
|
||||
bsr := heap.Pop(&bsm.bsrHeap).(*blockStreamReader)
|
||||
|
||||
if !bsm.phFirstItemCaught {
|
||||
ph.firstItem = append(ph.firstItem[:0], bsr.Block.items[0]...)
|
||||
bsm.phFirstItemCaught = true
|
||||
}
|
||||
|
||||
var nextItem []byte
|
||||
hasNextItem := false
|
||||
if len(bsm.bsrHeap) > 0 {
|
||||
@ -142,6 +137,10 @@ func (bsm *blockStreamMerger) flushIB(bsw *blockStreamWriter, ph *partHeader, it
|
||||
itemsCount := uint64(len(bsm.ib.items))
|
||||
ph.itemsCount += itemsCount
|
||||
atomic.AddUint64(itemsMerged, itemsCount)
|
||||
if !bsm.phFirstItemCaught {
|
||||
ph.firstItem = append(ph.firstItem[:0], bsm.ib.items[0]...)
|
||||
bsm.phFirstItemCaught = true
|
||||
}
|
||||
ph.lastItem = append(ph.lastItem[:0], bsm.ib.items[len(bsm.ib.items)-1]...)
|
||||
bsw.WriteBlock(&bsm.ib)
|
||||
bsm.ib.Reset()
|
||||
|
Loading…
Reference in New Issue
Block a user