diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index ac18f9d967..0d780fc2c7 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -2850,7 +2850,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 diff --git a/pkg/store/postings.go b/pkg/store/postings.go index 28fbf0cf01..e44dfbe66c 100644 --- a/pkg/store/postings.go +++ b/pkg/store/postings.go @@ -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") }