Get accurate start time and bytes started for each file uploaded to Remote Translog Store #9729
Labels
enhancement
Enhancement or improvement to existing feature or request
Storage:Remote
Storage
Issues and PRs relating to data and metadata storage
Is your feature request related to a problem? Please describe.
Currently, there is no way to capture the exact start time for a given file being uploaded to the Remote Translog Store. This information is essential to emit an accurate time duration spent on uploads.
Additionally, the same solution can be leveraged to emit the more accurate, point-in-time value of upload bytes started for Remote Translog Store uploads.
Describe the solution you'd like
Currently, we depend on the
ActionListener
interface andLatchedActionListener
to run logic on a successful or failed response for the remote upload:https://github.com/opensearch-project/OpenSearch/blob/d375e4cfea1a8e4c58dd1409365a67cf49366780/libs/core/src/main/java/org/opensearch/core/action/ActionListener.java
https://github.com/opensearch-project/OpenSearch/blob/d375e4cfea1a8e4c58dd1409365a67cf49366780/server/src/main/java/org/opensearch/action/LatchedActionListener.java
However, there is no way to pass a
beforeUpload
callback here. There isActionListener#runBefore()
, but that is triggered before passing on the received response. What we need is a way to trigger some logic before starting the actual upload.Describe alternatives you've considered
For the meantime, we are planning to consider the start time of sync to remote as the start time for calculating the time duration spent on uploads. Similarly, we add all the bytes of all files being attempted in the sync as the uploadBytesStarted value to add. Consequently, these values would likely be somewhat higher than the actual point-in-time values.
Additional context
Current callback logic on upload success:
OpenSearch/server/src/main/java/org/opensearch/index/translog/transfer/FileTransferTracker.java
Lines 35 to 38 in d375e4c
Current callback logic on upload failure:
OpenSearch/server/src/main/java/org/opensearch/index/translog/transfer/FileTransferTracker.java
Lines 54 to 57 in d375e4c
OpenSearch/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java
Lines 109 to 121 in d375e4c
Initial changes for capturing the upload start time and upload bytes started are being added as part of #9263
The text was updated successfully, but these errors were encountered: