From f4c63b90081f4712a91ed5d474bca0033291be6b Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar <15064823+codesome@users.noreply.github.com> Date: Fri, 27 Aug 2021 12:56:09 +0530 Subject: [PATCH] Fix a data race in the loadWAL function caused by reusing the same error var in multiple goroutines (#9259) (#9263) Signed-off-by: Callum Styan Co-authored-by: Callum Styan --- tsdb/head.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tsdb/head.go b/tsdb/head.go index b0124922e..5f0ae3c6b 100644 --- a/tsdb/head.go +++ b/tsdb/head.go @@ -602,6 +602,7 @@ func (h *Head) loadWAL(r *wal.Reader, multiRef map[uint64]uint64, mmappedChunks wg.Add(1) exemplarsInput = make(chan record.RefExemplar, 300) go func(input <-chan record.RefExemplar) { + var err error defer wg.Done() for e := range input { ms := h.series.getByID(e.Ref)