mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vminsert: correctly allocate buffer for storagenodes (#554)
in case of dynamic discovery number of nodes may change and we have to allocate new buffer for this case otherwise vminsert may panic
This commit is contained in:
parent
8b15f93426
commit
82e2f19bc2
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ func (ctx *InsertCtx) Reset() {
|
||||||
ctx.Labels = ctx.Labels[:0]
|
ctx.Labels = ctx.Labels[:0]
|
||||||
ctx.MetricNameBuf = ctx.MetricNameBuf[:0]
|
ctx.MetricNameBuf = ctx.MetricNameBuf[:0]
|
||||||
|
|
||||||
if ctx.bufRowss == nil {
|
if ctx.bufRowss == nil || len(ctx.bufRowss) != len(ctx.snb.sns) {
|
||||||
ctx.bufRowss = make([]bufRows, len(ctx.snb.sns))
|
ctx.bufRowss = make([]bufRows, len(ctx.snb.sns))
|
||||||
}
|
}
|
||||||
for i := range ctx.bufRowss {
|
for i := range ctx.bufRowss {
|
||||||
|
|
Loading…
Reference in a new issue