-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
cloud: fix gcs to resuming reader #66149
Conversation
Pulled this commit out of #65967 since we don't plan on merging that yet. |
e82cc6a
to
8885390
Compare
pkg/storage/cloud/cloud_io.go
Outdated
return 0, errors.Wrap(lastErr, "multiple Read calls return no data") | ||
// Check if the ResumingReader has been configured with retry-on-error | ||
// decider. | ||
if r.RetryOnErrFn != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should log if RetryOnErrFn is nil (so we're not retrying) and/or fall back to a default function (e.g. sysutil.IsErrConnectionReset) since you could imagine forgetting to set RetryOnErrFn
given we manually init the struct everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I moved the struct creation to a NewResumingReader method to centralize the init.
8885390
to
9a7dabc
Compare
This change does a few things: 1. gcs_storage was not returning a resuming reader as a result of which the Read method of the resuming reader that contains logic to retry on certain kinds of errors was not being invoked. 2, Changes the resuming reader to take a storage specific function that can define what errors are retryable in the resuming reader. All storage providers use the same deciding function at the moment and so behavior is unchanged. Release note: None
9a7dabc
to
22f6b33
Compare
TFTR! bors r=dt |
Build succeeded: |
This change is a minimal backport of cockroachdb#66149. It fixes a bug where GCS was not using the resuming reader on Read(). Release note (bug fix): Fixes a bug where google cloud storage was not using the resuming reader, as a result of which some retryable errors were not being treated as such, and the Read would fail.
This change does a few things:
which the Read method of the resuming reader that contains logic
to retry on certain kinds of errors was not being invoked.
2, Changes the resuming reader to take a storage specific function
that can define what errors are retryable in the resuming reader.
All storage providers use the same deciding function at the moment
and so behavior is unchanged.
Release note: None