Skip to content

Retry object store reads on temporary errors. #788

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

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

ryzhyk
Copy link
Contributor

@ryzhyk ryzhyk commented Dec 12, 2024

I noticed that, when reading many parquet files from S3, one of the reads fails occasionally with a temporary error such as "connection closed before message completed". I think such transient failures are normal for S3, and the client is expected to retry the read in this case. However, opendal was not configured to perform a retry. This commit adds a retry layer to opendal config for S3 and GCS object stores with the default configuration (exponential backoff with up to 3 retries).

This solves the issue for me. It might be useful to make this behavior configurable in the future, but default settings should work most of the time.

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Comparing to add retry layer for every service, how about adding it here?

pub(crate) fn create_operator<'a>(

@ryzhyk
Copy link
Contributor Author

ryzhyk commented Dec 13, 2024

Comparing to add retry layer for every service, how about adding it here?

pub(crate) fn create_operator<'a>(

Done, thanks for the feedback!

I noticed that, when reading many parquet files from S3, one of the
reads fails occasionally with a temporary error such as "connection
closed before message completed". I think such transient failures are
normal for S3, and the client is expected to retry the read in this
case. However, opendal was not configured to perform a retry. This
commit adds a retry layer to opendal with the default configuration
(exponential backoff with up to 3 retries).

This solves the issue for me. It might be useful to make this behavior
configurable in the future, but default settings should work most of the
time.

Signed-off-by: Leonid Ryzhyk <leonid@feldera.com>
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Great, @ryzhyk, thank you a lot for adding this!

@Xuanwo Xuanwo merged commit 75b41be into apache:main Dec 13, 2024
16 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.

2 participants