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

[BUG] S3RetryingInputStream incorrectly parses Content-Range value #9512

Closed
andrross opened this issue Aug 23, 2023 · 1 comment · Fixed by #9516
Closed

[BUG] S3RetryingInputStream incorrectly parses Content-Range value #9512

andrross opened this issue Aug 23, 2023 · 1 comment · Fixed by #9516
Assignees
Labels

Comments

@andrross
Copy link
Member

This REGEX is incorrect: https://github.com/opensearch-project/OpenSearch/blob/main/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/utils/HttpRangeUtils.java#L20

It does not match the "bytes 0-100/200" format specified by RFC 9110.

The result is that readBlob(String, long, long) is broken, and searchable snapshots is therefore broken.

We are also missing coverage of this API in https://github.com/opensearch-project/OpenSearch/blob/main/test/framework/src/main/java/org/opensearch/repositories/blobstore/OpenSearchBlobStoreRepositoryIntegTestCase.java

Related #9125

@andrross
Copy link
Member Author

I actually think this bug can manifest in the readBlob(String) method as well, because under the hood the S3RetryingInputStream can attempt to open a range after a failure part way through reading the stream (that's the "retrying" part). This would result in the long overflow error during the snapshot restore path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant