Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
salvacorts committed Dec 16, 2024
1 parent 1b19558 commit 452da00
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/storage/stores/shipper/indexshipper/tsdb/index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,11 @@ func (dec *Decoder) readSeriesStats(version int, d *encoding.Decbuf, stats **Str
return nil
}

// If stats are not requested (stats are nil), we can just skip through the stats
if stats == nil {
return dec.skipSeriesStats(d)
}

nSMFieldNames := d.Uvarint()

fields := make(map[string]struct{}, nSMFieldNames)
Expand All @@ -2266,6 +2271,14 @@ func (dec *Decoder) readSeriesStats(version int, d *encoding.Decbuf, stats **Str
return nil
}

func (dec *Decoder) skipSeriesStats(d *encoding.Decbuf) error {
nSMFieldNames := d.Uvarint()
for i := 0; i < nSMFieldNames; i++ {
_ = d.Uvarint()
}
return d.Err()
}

// prepSeriesBy returns series labels and chunks for a series and only returning selected `by` label names.
// If `by` is empty, it returns all labels for the series.
func (dec *Decoder) prepSeriesBy(version int, b []byte, lbls *labels.Labels, chks *[]ChunkMeta, stats **StreamStats, by map[string]struct{}) (*encoding.Decbuf, uint64, error) {
Expand Down

0 comments on commit 452da00

Please sign in to comment.