diff --git a/tsdb/compact_test.go b/tsdb/compact_test.go index 310fe8f25a..6e3db15eb4 100644 --- a/tsdb/compact_test.go +++ b/tsdb/compact_test.go @@ -1575,12 +1575,13 @@ func TestHeadCompactionWithHistograms(t *testing.T) { func TestSparseHistogramSpaceSavings(t *testing.T) { t.Skip() - cases := []struct { + type testcase struct { numSeriesPerSchema int numBuckets int numSpans int gapBetweenSpans int - }{ + } + cases := []testcase{ {1, 15, 1, 0}, {1, 50, 1, 0}, {1, 100, 1, 0}, @@ -1692,7 +1693,7 @@ func TestSparseHistogramSpaceSavings(t *testing.T) { }() wg.Add(1) - go func() { + go func(c testcase) { defer wg.Done() // Ingest histograms the old way. @@ -1740,7 +1741,7 @@ func TestSparseHistogramSpaceSavings(t *testing.T) { oldULIDs, err = compactor.Write(oldHead.opts.ChunkDirRoot, oldHead, mint, maxt, nil) require.NoError(t, err) require.Len(t, oldULIDs, 1) - }() + }(c) wg.Wait() diff --git a/tsdb/head_wal.go b/tsdb/head_wal.go index e9557c59f6..0afe84a875 100644 --- a/tsdb/head_wal.go +++ b/tsdb/head_wal.go @@ -694,9 +694,9 @@ func (h *Head) loadWBL(r *wlog.Reader, syms *labels.SymbolTable, multiRef map[ch go func() { defer close(decodedCh) - var err error dec := record.NewDecoder(syms) for r.Next() { + var err error rec := r.Record() switch dec.Type(rec) { case record.Samples: