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 <callumstyan@gmail.com>

Co-authored-by: Callum Styan <callumstyan@gmail.com>
This commit is contained in:
Ganesh Vernekar 2021-08-27 12:56:09 +05:30 committed by GitHub
parent dcb07e8eac
commit f4c63b9008
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)