mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vminsert: properly reset InsertCtx.mrs - they must be empty after Reset call
This commit is contained in:
parent
437e0b2300
commit
0eae39daa7
1 changed files with 1 additions and 2 deletions
|
@ -30,11 +30,10 @@ func (ctx *InsertCtx) Reset(rowsLen int) {
|
||||||
mr.MetricNameRaw = nil
|
mr.MetricNameRaw = nil
|
||||||
}
|
}
|
||||||
ctx.mrs = ctx.mrs[:0]
|
ctx.mrs = ctx.mrs[:0]
|
||||||
|
|
||||||
if n := rowsLen - cap(ctx.mrs); n > 0 {
|
if n := rowsLen - cap(ctx.mrs); n > 0 {
|
||||||
ctx.mrs = append(ctx.mrs[:cap(ctx.mrs)], make([]storage.MetricRow, n)...)
|
ctx.mrs = append(ctx.mrs[:cap(ctx.mrs)], make([]storage.MetricRow, n)...)
|
||||||
}
|
}
|
||||||
ctx.mrs = ctx.mrs[:rowsLen]
|
ctx.mrs = ctx.mrs[:0]
|
||||||
ctx.metricNamesBuf = ctx.metricNamesBuf[:0]
|
ctx.metricNamesBuf = ctx.metricNamesBuf[:0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue