diff --git a/app/vminsert/graphite/request_handler.go b/app/vminsert/graphite/request_handler.go index 73f373a60c..14a557fba1 100644 --- a/app/vminsert/graphite/request_handler.go +++ b/app/vminsert/graphite/request_handler.go @@ -32,6 +32,7 @@ func insertRows(at *auth.Token, rows []parser.Row) error { ctx := netstorage.GetInsertCtx() defer netstorage.PutInsertCtx(ctx) + ctx.Reset() // This line is required for initializing ctx internals. atCopy := *at for i := range rows { r := &rows[i] diff --git a/app/vminsert/influx/request_handler.go b/app/vminsert/influx/request_handler.go index a44dff13e2..d6ae61becf 100644 --- a/app/vminsert/influx/request_handler.go +++ b/app/vminsert/influx/request_handler.go @@ -59,6 +59,7 @@ func insertRows(at *auth.Token, db string, rows []parser.Row) error { defer putPushCtx(ctx) ic := &ctx.Common + ic.Reset() // This line is required for initializing ic internals. rowsTotal := 0 for i := range rows { r := &rows[i] diff --git a/app/vminsert/opentsdb/request_handler.go b/app/vminsert/opentsdb/request_handler.go index c7125211d6..8d4ce0ba26 100644 --- a/app/vminsert/opentsdb/request_handler.go +++ b/app/vminsert/opentsdb/request_handler.go @@ -32,6 +32,7 @@ func insertRows(at *auth.Token, rows []parser.Row) error { ctx := netstorage.GetInsertCtx() defer netstorage.PutInsertCtx(ctx) + ctx.Reset() // This line is required for initializing ctx internals. atCopy := *at for i := range rows { r := &rows[i] diff --git a/app/vminsert/opentsdbhttp/request_handler.go b/app/vminsert/opentsdbhttp/request_handler.go index 039db953d1..4dccbe5292 100644 --- a/app/vminsert/opentsdbhttp/request_handler.go +++ b/app/vminsert/opentsdbhttp/request_handler.go @@ -50,6 +50,7 @@ func insertRows(at *auth.Token, rows []parser.Row) error { ctx := netstorage.GetInsertCtx() defer netstorage.PutInsertCtx(ctx) + ctx.Reset() // This line is required for initializing ctx internals. for i := range rows { r := &rows[i] ctx.Labels = ctx.Labels[:0] diff --git a/app/vminsert/promremotewrite/request_handler.go b/app/vminsert/promremotewrite/request_handler.go index 8b0b5e58f3..04e29acfb3 100644 --- a/app/vminsert/promremotewrite/request_handler.go +++ b/app/vminsert/promremotewrite/request_handler.go @@ -31,6 +31,7 @@ func insertRows(at *auth.Token, timeseries []prompb.TimeSeries) error { ctx := netstorage.GetInsertCtx() defer netstorage.PutInsertCtx(ctx) + ctx.Reset() // This line is required for initializing ctx internals. rowsTotal := 0 for i := range timeseries { ts := ×eries[i] diff --git a/app/vminsert/vmimport/request_handler.go b/app/vminsert/vmimport/request_handler.go index c563be5c04..377f229797 100644 --- a/app/vminsert/vmimport/request_handler.go +++ b/app/vminsert/vmimport/request_handler.go @@ -32,6 +32,7 @@ func insertRows(at *auth.Token, rows []parser.Row) error { ctx := netstorage.GetInsertCtx() defer netstorage.PutInsertCtx(ctx) + ctx.Reset() // This line is required for initializing ctx internals. rowsTotal := 0 for i := range rows { r := &rows[i]