Skip to content

Save chunks to cache if GetChunks returns partial result#605

Merged
bboreham merged 1 commit intomasterfrom
cache-chunks-on-error
Nov 22, 2017
Merged

Save chunks to cache if GetChunks returns partial result#605
bboreham merged 1 commit intomasterfrom
cache-chunks-on-error

Conversation

@bboreham
Copy link
Contributor

If the chunk store has, say, 1,000 chunks to fetch, it will do them in a loop in batches of 100. Suppose it gets 900 fetched ok, then the next call hits an error: we should save the 900 to cache.

Reason is the client may be on a retry loop and come straight back with the same request. So we should cache what we did get, and hence do better next time.

Note we do not retain any chunks obtained by a call which did error; just the ones from earlier successful calls.

Often, the error is caused by a timeout or client cancel, but the
client may be on a retry loop and come straight back with the same
request.  So we should cache what we did get, and hence do better next
time.
@tomwilkie tomwilkie mentioned this pull request Nov 20, 2017
26 tasks
@bboreham bboreham requested a review from jml November 21, 2017 10:37
Copy link
Contributor

@jml jml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, cool. I'd be interested in seeing before & after stats on this. (But only ~15 minutes of effort interested).

@bboreham bboreham merged commit d6b6580 into master Nov 22, 2017
@bboreham bboreham deleted the cache-chunks-on-error branch January 4, 2018 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants