Skip to content

Commit

Permalink
Add sanity check to fetchChunkRemainder
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
  • Loading branch information
dimitarvdimitrov committed May 15, 2023
1 parent 116dafe commit 645844a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/storegateway/bucket_chunk_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ func (r *bucketChunkReader) loadChunks(ctx context.Context, res []seriesChunks,
}

func (r *bucketChunkReader) fetchChunkRemainder(ctx context.Context, seq int, offset, length int64, dest []byte, localStats *queryStats) error {
if length != int64(len(dest)) {
return fmt.Errorf("byte range length (%d) different from destination length (%d)", length, len(dest))
}
refetchReader, err := r.block.chunkRangeReader(ctx, seq, offset, length)
if err != nil {
return errors.Wrap(err, "open chunk reader")
Expand Down

0 comments on commit 645844a

Please sign in to comment.