From 1ab593f80754abf0292db98c9c4fe1bd7ce66aa0 Mon Sep 17 00:00:00 2001 From: f41gh7 Date: Tue, 14 Mar 2023 11:27:24 +0100 Subject: [PATCH] app/vminsert: fixes merge conflicts --- app/vminsert/seriesupdate/request_handler.go | 7 ++++--- app/vmselect/netstorage/netstorage.go | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/vminsert/seriesupdate/request_handler.go b/app/vminsert/seriesupdate/request_handler.go index 9af559fda..83305dc20 100644 --- a/app/vminsert/seriesupdate/request_handler.go +++ b/app/vminsert/seriesupdate/request_handler.go @@ -8,7 +8,8 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/app/vminsert/netstorage" "github.com/VictoriaMetrics/VictoriaMetrics/lib/auth" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" - parser "github.com/VictoriaMetrics/VictoriaMetrics/lib/protoparser/vmimport" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/protoparser/vmimport" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/protoparser/vmimport/stream" "github.com/VictoriaMetrics/VictoriaMetrics/lib/storage" "github.com/VictoriaMetrics/VictoriaMetrics/lib/tenantmetrics" "github.com/VictoriaMetrics/metrics" @@ -29,12 +30,12 @@ func generateUniqueGenerationID() []byte { // InsertHandler processes `/api/v1/update/series` request. func InsertHandler(at *auth.Token, req *http.Request) error { isGzipped := req.Header.Get("Content-Encoding") == "gzip" - return parser.ParseStream(req.Body, isGzipped, func(rows []parser.Row) error { + return stream.Parse(req.Body, isGzipped, func(rows []vmimport.Row) error { return insertRows(at, rows) }) } -func insertRows(at *auth.Token, rows []parser.Row) error { +func insertRows(at *auth.Token, rows []vmimport.Row) error { ctx := netstorage.GetInsertCtx() defer netstorage.PutInsertCtx(ctx) diff --git a/app/vmselect/netstorage/netstorage.go b/app/vmselect/netstorage/netstorage.go index 1e11da36d..b7002810b 100644 --- a/app/vmselect/netstorage/netstorage.go +++ b/app/vmselect/netstorage/netstorage.go @@ -587,6 +587,9 @@ func (pts *packedTimeseries) Unpack(dst *Result, tbfs []*tmpBlocksFile, tr stora dedupInterval := storage.GetDedupInterval() mergeSortBlocks(dst, sbh, dedupInterval) seriesUpdateSbss, err := pts.unpackUpdateAddrs(tbfs, tr) + if err != nil { + return fmt.Errorf("cannot unpack series updates: %w", err) + } // apply updates if len(seriesUpdateSbss) > 0 { var updateDst Result