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

cloud: fix gcs to resuming reader #66149

Merged
merged 1 commit into from
Jun 8, 2021

Conversation

adityamaru
Copy link
Contributor

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

@adityamaru adityamaru requested a review from dt June 7, 2021 17:57
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@adityamaru
Copy link
Contributor Author

Pulled this commit out of #65967 since we don't plan on merging that yet.

@adityamaru adityamaru force-pushed the resuming-reader-fix branch from e82cc6a to 8885390 Compare June 7, 2021 18:09
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 {
Copy link
Member

@dt dt Jun 8, 2021

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?

Copy link
Contributor Author

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.

@adityamaru adityamaru force-pushed the resuming-reader-fix branch from 8885390 to 9a7dabc Compare June 8, 2021 13:50
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
@adityamaru adityamaru force-pushed the resuming-reader-fix branch from 9a7dabc to 22f6b33 Compare June 8, 2021 13:54
@adityamaru
Copy link
Contributor Author

TFTR!

bors r=dt

@craig
Copy link
Contributor

craig bot commented Jun 8, 2021

Build succeeded:

@craig craig bot merged commit d1c46b4 into cockroachdb:master Jun 8, 2021
adityamaru added a commit to adityamaru/cockroach that referenced this pull request Jun 10, 2021
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.
@adityamaru adityamaru deleted the resuming-reader-fix branch July 6, 2021 18:32
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