From 9d81b2d610bfe8ec9c988e87b6f0f06e6b6004f8 Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar Date: Tue, 5 Oct 2021 14:21:24 +0530 Subject: [PATCH] Fix tests Signed-off-by: Ganesh Vernekar --- tsdb/head_append.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tsdb/head_append.go b/tsdb/head_append.go index dbec3e49e..cc200e9e2 100644 --- a/tsdb/head_append.go +++ b/tsdb/head_append.go @@ -609,7 +609,13 @@ func (s *memSeries) appendHistogram(t int64, sh histogram.SparseHistogram, appen // We check for Appendable before appendPreprocessor because in case it ends up creating a new chunk, // we need to know if there was also a counter reset or not to set the meta properly. app, _ := s.app.(*chunkenc.HistoAppender) - posInterjections, negInterjections, ok, counterReset := app.Appendable(sh) + var ( + posInterjections, negInterjections []chunkenc.Interjection + ok, counterReset bool + ) + if app != nil { + posInterjections, negInterjections, ok, counterReset = app.Appendable(sh) + } c, sampleInOrder, chunkCreated := s.appendPreprocessor(t, chunkenc.EncSHS, chunkDiskMapper) if !sampleInOrder {