From 0eae39daa79d4fad8a961c2a02549d2305022427 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 28 May 2019 16:08:01 +0300 Subject: [PATCH] app/vminsert: properly reset InsertCtx.mrs - they must be empty after Reset call --- app/vminsert/common/insert_ctx.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/vminsert/common/insert_ctx.go b/app/vminsert/common/insert_ctx.go index 65fff3ec1..190a4678d 100644 --- a/app/vminsert/common/insert_ctx.go +++ b/app/vminsert/common/insert_ctx.go @@ -30,11 +30,10 @@ func (ctx *InsertCtx) Reset(rowsLen int) { mr.MetricNameRaw = nil } ctx.mrs = ctx.mrs[:0] - if n := rowsLen - cap(ctx.mrs); n > 0 { 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] }