Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ingester: shortcut fetchWants that have already been satisfied #9891

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/storage/ingest/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ func (r *concurrentFetchers) start(ctx context.Context, startOffset int64, concu
}
nextFetch = nextFetch.UpdateBytesPerRecord(result.fetchedBytes, len(result.Records))

for recs := result.Records; len(recs) > 0 && recs[len(recs)-1].Offset >= nextFetch.endOffset; {
// We just received some records. If the nextFetch is already covered by these, then we can avoid fetching it.
nextFetch = nextFetch.Next(recordsPerFetch)
}
// We have some ordered records ready to be sent to PollFetches(). We store the fetch
// result in bufferedResult, and we flip readyBufferedResults to the channel used by
// PollFetches().
Expand Down
Loading