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

Only prefetch on successful partial read #4658

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Only prefetch on successful partial read #4658

merged 1 commit into from
Apr 8, 2024

Conversation

polyrabbit
Copy link
Contributor

When s3 storage is unhealthy, we see lots of failed read requests for the same key - half of them are triggered by prefetch. Actually only a successful partial read needs a prefetch.

return n, nil
} else {
s.store.objectReqErrors.Add(1)
return n, err
Copy link
Contributor

Choose a reason for hiding this comment

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

we want to try everything we can do before failure, don't return here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need a way to distinguish retriable errors, otherwise we will have a large read amplification.

@@ -224,7 +224,7 @@ func (s *sliceReader) run() {
_ = f.r.m.InvalidateChunkCache(meta.Background, inode, indx)
if f.tried > f.r.maxRetries {
s.done(err, 0)
} else {
} else { // Why retry here since we already have retried in `cachedStore.load`?
Copy link
Contributor

Choose a reason for hiding this comment

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

This is another level of retry. The slices obtained from the meta.Read method may be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, updated

@davies davies merged commit d33cf1f into juicedata:main Apr 8, 2024
32 checks passed
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.

3 participants