-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add support for range reads and retries to URL repositories #69521
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
Conversation
dfe16f1
to
be9ac38
Compare
Pinging @elastic/es-distributed (Team:Distributed) |
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.
Thank you for working on this @fcofdez. I've done a first pass and left some comments. I'm also wondering how the change to the HTTP client will affect https with custom certificates. Is the keystore used still the same?
...epository-url/src/main/java/org/elasticsearch/common/blobstore/url/HttpURLBlobContainer.java
Outdated
Show resolved
Hide resolved
...epository-url/src/main/java/org/elasticsearch/common/blobstore/url/HttpURLBlobContainer.java
Outdated
Show resolved
Hide resolved
...epository-url/src/main/java/org/elasticsearch/common/blobstore/url/HttpURLBlobContainer.java
Outdated
Show resolved
Hide resolved
...epository-url/src/main/java/org/elasticsearch/common/blobstore/url/HttpURLBlobContainer.java
Outdated
Show resolved
Hide resolved
...epository-url/src/main/java/org/elasticsearch/common/blobstore/url/HttpURLBlobContainer.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
@Override | ||
public InputStream readBlob(String blobName, long position, long length) throws IOException { | ||
throw new UnsupportedOperationException(); | ||
final InputStream inputStream = getInputStream(new URL(path, blobName)); |
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 would prefer to keep throwing UnsupportedOperationException
here, as we should not support something with horrible performance characteristics.
In a separate PR, I think we should also make sure that users are using "fs" repository types when accessing shared filesystems instead of URL repositories (by changing docs).
In yet a separate PR, we can remove support for "file" in URL repositories in ES 8.0.
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.
👍
...epository-url/src/main/java/org/elasticsearch/plugin/repository/url/URLRepositoryPlugin.java
Outdated
Show resolved
Hide resolved
...epository-url/src/main/java/org/elasticsearch/plugin/repository/url/URLRepositoryPlugin.java
Outdated
Show resolved
Hide resolved
...epository-url/src/main/java/org/elasticsearch/plugin/repository/url/URLRepositoryPlugin.java
Outdated
Show resolved
Hide resolved
modules/repository-url/src/main/java/org/elasticsearch/common/blobstore/url/URLBlobStore.java
Outdated
Show resolved
Hide resolved
By default it uses:
To be honest I'm not sure if this behaves the same way as it does today. |
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've left more comments. One point I want to emphasize is that I think the exception handling in RetryingInputStream needs to be reworked.
To be honest I'm not sure if this behaves the same way as it does today.
can you follow-up with the es-security team on that?
...epository-url/src/main/java/org/elasticsearch/common/blobstore/url/FileURLBlobContainer.java
Outdated
Show resolved
Hide resolved
...epository-url/src/main/java/org/elasticsearch/common/blobstore/url/HttpURLBlobContainer.java
Outdated
Show resolved
Hide resolved
...sitory-url/src/main/java/org/elasticsearch/common/blobstore/url/RetryingHttpInputStream.java
Outdated
Show resolved
Hide resolved
...sitory-url/src/main/java/org/elasticsearch/common/blobstore/url/RetryingHttpInputStream.java
Outdated
Show resolved
Hide resolved
throw new NoSuchFileException("blob object [" + blobName + "] not found"); | ||
} | ||
|
||
if (response.getStatusCode() > 299) { |
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 think we should be more restrictive here, and only allow 200 (OK) and 206 (Partial Content).
...sitory-url/src/main/java/org/elasticsearch/common/blobstore/url/RetryingHttpInputStream.java
Outdated
Show resolved
Hide resolved
...sitory-url/src/main/java/org/elasticsearch/common/blobstore/url/RetryingHttpInputStream.java
Outdated
Show resolved
Hide resolved
...sitory-url/src/main/java/org/elasticsearch/common/blobstore/url/RetryingHttpInputStream.java
Outdated
Show resolved
Hide resolved
modules/repository-url/src/main/plugin-metadata/plugin-security.policy
Outdated
Show resolved
Hide resolved
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.
LGTM. AFAICS it will use the default keystore so no change in behavior
@elasticmachine update branch |
@elasticmachine update branch |
Today we document that you can use URL repositories with searchable snapshots, but in fact it only works for HTTP(S) repositories. This commit adjusts the docs to clarify. Relates elastic#69521
Today we document that you can use URL repositories with searchable snapshots, but in fact it only works for HTTP(S) repositories. This commit adjusts the docs to clarify. Relates #69521
Today we document that you can use URL repositories with searchable snapshots, but in fact it only works for HTTP(S) repositories. This commit adjusts the docs to clarify. Relates elastic#69521
Today we document that you can use URL repositories with searchable snapshots, but in fact it only works for HTTP(S) repositories. This commit adjusts the docs to clarify. Relates elastic#69521
Today we document that you can use URL repositories with searchable snapshots, but in fact it only works for HTTP(S) repositories. This commit adjusts the docs to clarify. Relates elastic#69521
Today we document that you can use URL repositories with searchable snapshots, but in fact it only works for HTTP(S) repositories. This commit adjusts the docs to clarify. Relates elastic#69521
This PR adds support for range reads to URL based repositories and improves the resiliency for the http based URLs. Since the
URL
http client is quite limited I've decided to use the apache http client, since we already use it in other plugins (s3). There's quite a bit of boilerplate for license headers, etc. The scope of the change is quite limited.As a follow up, I'll add integration tests for searchable snapshots using an
URL
repository.