Skip to content

Commit

Permalink
Store: fix postings reader short reads
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaHoffmann committed Aug 31, 2023
1 parent ea67282 commit 1b3b466
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -2847,7 +2847,7 @@ func (r *bucketIndexReader) fetchPostings(ctx context.Context, keys []labels.Lab
r.stats.PostingsFetchDurationSum += time.Since(begin)
r.mtx.Unlock()

if rdr.Error() != nil {
if err := rdr.Error(); err != nil {
return errors.Wrap(err, "reading postings")
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/store/postings.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newPostingsReaderBuilder(ctx context.Context, r *bufio.Reader, postings []p
}

func getInt32(r io.Reader, buf []byte) (uint32, error) {
read, err := r.Read(buf)
read, err := io.ReadFull(r, buf)
if err != nil {
return 0, errors.Wrap(err, "reading")
}
Expand Down

0 comments on commit 1b3b466

Please sign in to comment.