diff --git a/storage/interface.go b/storage/interface.go index 5f0be9db9..3e8dd1086 100644 --- a/storage/interface.go +++ b/storage/interface.go @@ -422,7 +422,7 @@ type Labels interface { type SampleIterable interface { // Iterator returns an iterator of the data of the series. - // The iterator passed as argument is for re-use. + // The iterator passed as argument is for re-use, if not nil. // Depending on implementation, the iterator can // be re-used or a new iterator can be allocated. Iterator(chunkenc.Iterator) chunkenc.Iterator diff --git a/storage/series.go b/storage/series.go index 339beb2c9..377c060f7 100644 --- a/storage/series.go +++ b/storage/series.go @@ -287,7 +287,7 @@ func (s *seriesToChunkEncoder) Iterator(it chunks.Iterator) chunks.Iterator { mint := int64(math.MaxInt64) maxt := int64(math.MinInt64) - chks := []chunks.Meta{} + var chks []chunks.Meta lcsi, existing := it.(*listChunkSeriesIterator) if existing { chks = lcsi.chks[:0] diff --git a/tsdb/querier.go b/tsdb/querier.go index 642e089aa..89e3d5719 100644 --- a/tsdb/querier.go +++ b/tsdb/querier.go @@ -426,7 +426,7 @@ func labelNamesWithMatchers(r IndexReader, matchers ...*labels.Matcher) ([]strin return r.LabelNamesFor(postings...) } -// These are the things fetched when we move from one series to another. +// seriesData, used inside other iterators, are updated when we move from one series to another. type seriesData struct { chks []chunks.Meta intervals tombstones.Intervals