-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add async blob read and download support using multiple streams #9592
Add async blob read and download support using multiple streams #9592
Conversation
Compatibility status:Checks if related components are compatible with change 6a7e26c Incompatible componentsSkipped componentsCompatible components |
Gradle Check (Jenkins) Run Completed with:
|
1250157
to
62fbe0d
Compare
.../src/main/java/org/opensearch/common/blobstore/stream/read/listener/ReadContextListener.java
Outdated
Show resolved
Hide resolved
...main/java/org/opensearch/common/blobstore/stream/read/listener/StreamCompletionListener.java
Outdated
Show resolved
Hide resolved
...main/java/org/opensearch/common/blobstore/stream/read/listener/StreamCompletionListener.java
Outdated
Show resolved
Hide resolved
...main/java/org/opensearch/common/blobstore/stream/read/listener/StreamCompletionListener.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/opensearch/common/blobstore/stream/read/listener/FileCompletionListener.java
Outdated
Show resolved
Hide resolved
...t/java/org/opensearch/common/blobstore/stream/read/listener/FileCompletionListenerTests.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
Force pushed in quick succession. |
Compatibility status:Checks if related components are compatible with change f77ed82 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/cross-cluster-replication.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git] |
Compatibility status:Checks if related components are compatible with change f85700b Incompatible componentsIncompatible components: [https://github.com/opensearch-project/cross-cluster-replication.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git] |
Gradle Check (Jenkins) Run Completed with:
|
.../src/test/java/org/opensearch/common/blobstore/stream/read/listener/FilePartWriterTests.java
Outdated
Show resolved
Hide resolved
...er/src/test/java/org/opensearch/common/blobstore/stream/read/listener/ListenerTestUtils.java
Outdated
Show resolved
Hide resolved
...er/src/test/java/org/opensearch/common/blobstore/stream/read/listener/ListenerTestUtils.java
Outdated
Show resolved
Hide resolved
f85700b
to
3ebea21
Compare
Gradle Check (Jenkins) Run Completed with:
|
The connection to jenkins went down. |
Compatibility status:Checks if related components are compatible with change 3ebea21 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/cross-cluster-replication.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git] |
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Kunal Kotwani <[email protected]>
3ebea21
to
39c3920
Compare
Compatibility status:Checks if related components are compatible with change 39c3920 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/cross-cluster-replication.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git] |
Gradle Check (Jenkins) Run Completed with:
|
int bytesRead; | ||
while ((bytesRead = inputStream.read(buffer)) != -1) { | ||
Channels.writeToChannel(buffer, 0, bytesRead, outputFileChannel, streamOffset); | ||
streamOffset += bytesRead; | ||
} |
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.
Assuming this isn't doing DIRECT_IO, it might thrash page cache for encrypted data transfers? Can we instead use FileChannel#transferFrom
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.
transferFrom
does not support repositioning the channel beyond the file length. With multi threaded operation and a new file, we do not have the complete file at hand. We might have to resort using individual files and stitching logic in that case.
Signed-off-by: Kunal Kotwani <[email protected]> (cherry picked from commit 6765b16) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
… (#9696) (cherry picked from commit 6765b16) Signed-off-by: Kunal Kotwani <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
} | ||
} | ||
|
||
void processFailure(Exception e) { |
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.
What happens if the JVM crashes before the clean up gets triggered? Can you please write an IT to ensure that this case doesn't lead to corruption?
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.
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.
Good call out. Should we write to a file with a different name (i.e. add something like a ".multipart" suffix) and rename to the actual filename upon completion?
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.
Added an issue here: #9784
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.
Thanks @Bukhtawar and @andrross!
…search-project#9592) Signed-off-by: Kunal Kotwani <[email protected]> Signed-off-by: Kaushal Kumar <[email protected]>
…search-project#9592) Signed-off-by: Kunal Kotwani <[email protected]> Signed-off-by: Ivan Brusic <[email protected]>
…search-project#9592) Signed-off-by: Kunal Kotwani <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
Implementation details
The request flow can be visualized using the following diagram:
Related Issues
Partially resolves #9031
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.