-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Remote Translog] Introduce remote translog transfer support #4480
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
d988288
to
a77c864
Compare
Gradle Check (Jenkins) Run Completed with:
|
a77c864
to
df71151
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
bd5f1de
to
d696e19
Compare
Gradle Check (Jenkins) Run Completed with:
|
d696e19
to
0fcdc6e
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
8df5484
to
104108f
Compare
Gradle Check (Jenkins) Run Completed with:
|
104108f
to
f593c45
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
server/src/main/java/org/opensearch/index/translog/transfer/BlobStoreTransferService.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
8f1df36
to
b32908a
Compare
Gradle Check (Jenkins) Run Completed with:
|
b32908a
to
a1bad44
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
try { | ||
return readByte() & 0xFF; | ||
} catch (EOFException e) { | ||
return -1; | ||
} |
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.
why do we need this change ?
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.
This is due to an interface contract that OpenSearch was breaking. This is unrelated to the change
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.
It looks like we have a base contract test for a stream input. Can you create an issue to create a contract test for this class since you've got the full context for this specific miss?
server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java
Show resolved
Hide resolved
try { | ||
return readByte() & 0xFF; | ||
} catch (EOFException e) { | ||
return -1; | ||
} |
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.
It looks like we have a base contract test for a stream input. Can you create an issue to create a contract test for this class since you've got the full context for this specific miss?
server/src/main/java/org/opensearch/index/translog/transfer/FileSnapshot.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/translog/transfer/FileSnapshot.java
Show resolved
Hide resolved
Iterable<String> remoteTransferPath, | ||
ActionListener<TransferFileSnapshot> listener | ||
) { | ||
assert remoteTransferPath instanceof BlobPath; |
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.
Since you currently only have one instance of a TransferService, I would recommend not introducing an interface and do things like this. It's easy enough to refactor out an interface if/when you need it, but until you really need it you can only make educated guesses about what the generic interface should look like. Not a huge deal, I'll defer to your preference.
server/src/main/java/org/opensearch/index/translog/transfer/BlobStoreTransferService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/index/translog/transfer/FileTransferException.java
Outdated
Show resolved
Hide resolved
} | ||
translogTransferSnapshot.setMinTranslogGeneration(highestGenMinTranslogGeneration); | ||
|
||
assert this.primaryTerm == highestGenPrimaryTerm : "inconsistent primary term"; |
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.
Again with me complaining about asserts :) but I would enforce these constraints unconditionally. Performance doesn't seem like a concern since the work is done unconditionally. Same applies for line 50.
I won't block on this issue if you strongly prefer asserts, but regardless we should have unit tests for these constraints.
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'll stick with this for now and make changes as needed once we added tests for this.
server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Bukhtawar Khan <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Bukhtawar Khan <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Bukhtawar Khan <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
@@ -50,6 +50,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
- Relax visibility of the HTTP_CHANNEL_KEY and HTTP_SERVER_CHANNEL_KEY to make it possible for the plugins to access associated Netty4HttpChannel / Netty4HttpServerChannel instance ([#4638](https://github.com/opensearch-project/OpenSearch/pull/4638)) | |||
- Use ReplicationFailedException instead of OpensearchException in ReplicationTarget ([#4725](https://github.com/opensearch-project/OpenSearch/pull/4725)) | |||
- Migrate client transports to Apache HttpClient / Core 5.x ([#4459](https://github.com/opensearch-project/OpenSearch/pull/4459)) | |||
- Support remote translog transfer for request level durability([#4480](https://github.com/opensearch-project/OpenSearch/pull/4480)) |
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.
This should go in the Unreleased 2.x
section provided this will be backported.
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.
Ack
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-4480-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a8b5d91bc8b6b2a79fa042d22775959043dac145
# Push it to GitHub
git push --set-upstream origin backport/backport-4480-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
…rch-project#4480) * Introduce remote translog transfer support Signed-off-by: Bukhtawar Khan <[email protected]>
…rch-project#4480) * Introduce remote translog transfer support Signed-off-by: Bukhtawar Khan <[email protected]>
…5693) * [Backport 2.x] Introduce remote translog transfer support Signed-off-by: Bukhtawar Khan <[email protected]>
* Introduce remote translog transfer support Signed-off-by: Bukhtawar Khan <[email protected]>
…rch-project#4480) * Introduce remote translog transfer support Signed-off-by: Bukhtawar Khan <[email protected]>
…5773) * Introduce remote translog transfer support Signed-off-by: Bukhtawar Khan <[email protected]>
…5693) * [Backport 2.x] Introduce remote translog transfer support Signed-off-by: Bukhtawar Khan <[email protected]>
Signed-off-by: Bukhtawar Khan [email protected]
Description
The changes introduces support for blob store based remote translog store. The changes contain the remote transfer service interactions and snapshots data needed to be uploaded per commit.
Remote Translog Files and Location
Contents of Remote Translog Files
Tests : Work In progress
Issues Resolved
[List any issues this PR will resolve]
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.