mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
lib/storage: fix infinite loop introduced in aa9b56a046
This commit is contained in:
parent
aa9b56a046
commit
dcbc22552f
@ -485,14 +485,11 @@ func (rrs *rawRowsShard) addRows(pt *partition, rows []rawRow) {
|
||||
rrs.rows = make([]rawRow, 0, n)
|
||||
}
|
||||
maxRowsCount := cap(rrs.rows)
|
||||
for {
|
||||
capacity := maxRowsCount - len(rrs.rows)
|
||||
if capacity >= len(rows) {
|
||||
// Fast path - rows fit capacity.
|
||||
rrs.rows = append(rrs.rows, rows...)
|
||||
break
|
||||
}
|
||||
|
||||
capacity := maxRowsCount - len(rrs.rows)
|
||||
if capacity >= len(rows) {
|
||||
// Fast path - rows fit capacity.
|
||||
rrs.rows = append(rrs.rows, rows...)
|
||||
} else {
|
||||
// Slow path - rows don't fit capacity.
|
||||
// Put rrs.rows and rows to rowsToFlush and convert it to a part.
|
||||
rowsToFlush = append(rowsToFlush, rrs.rows...)
|
||||
|
Loading…
Reference in New Issue
Block a user