-
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] Trimming based on remote segment upload and cleaning older tlog files #5662
Conversation
Gradle Check (Jenkins) Run Completed with:
|
a8e3ba0
to
e1f2c43
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #5662 +/- ##
============================================
+ Coverage 71.02% 71.04% +0.02%
- Complexity 58708 58727 +19
============================================
Files 4766 4766
Lines 280049 280087 +38
Branches 40434 40436 +2
============================================
+ Hits 198892 198989 +97
+ Misses 64945 64786 -159
- Partials 16212 16312 +100
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -47,6 +47,8 @@ public class RemoteFsTranslog extends Translog { | |||
private final FileTransferTracker fileTransferTracker; | |||
private volatile long maxRemoteTranslogGenerationUploaded; | |||
|
|||
private volatile long minSeqNoToKeep; |
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.
The default value of 0 should be good when minSeqNoToKeep
has not been set ever?
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.
Could there be a case when a replica-primary promotion has happened and this has not been initialised or primary-primary relocation (peer recovery) in which case this can be problematic?
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.
In worst case, the default value of 0 would prevent further truncations. There would be some assertion failures , which would be disabled in prod.
Gradle Check (Jenkins) Run Completed with:
|
protected void setMinSeqNoToKeep(long seqNo) { | ||
if (seqNo < this.minSeqNoToKeep) { | ||
throw new IllegalArgumentException( | ||
"min seq number required can't go backwards: " + "current [" + this.minSeqNoToKeep + "] new [" + seqNo + "]" | ||
); | ||
} | ||
this.minSeqNoToKeep = seqNo; |
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.
For my understanding min should be able to go lower right?
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.
No, once it is set to x +10
, then we should not be able to set it to x
,as 0..x
operations could have been deleted by then . We can set it to x+20
after that .
server/src/main/java/org/opensearch/index/translog/RemoteFsTranslog.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
463c931
to
3186594
Compare
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Gradle Check (Jenkins) Run Completed with:
|
Created #5791 as per @Bukhtawar's suggestion . |
…g older tlog files (opensearch-project#5662) * RemoteFSTranslog Trimming and GC Logic Signed-off-by: Gaurav Bafna <gbbafna@amazon.com> Signed-off-by: Sachin Kale <kalsac@amazon.com>
…g older tlog files (opensearch-project#5662) * RemoteFSTranslog Trimming and GC Logic Signed-off-by: Gaurav Bafna <gbbafna@amazon.com> Signed-off-by: Sachin Kale <kalsac@amazon.com>
…g older tlog files (opensearch-project#5662) * RemoteFSTranslog Trimming and GC Logic Signed-off-by: Gaurav Bafna <gbbafna@amazon.com> Signed-off-by: Sachin Kale <kalsac@amazon.com>
…g older tlog files (opensearch-project#5662) (opensearch-project#5793) * RemoteFSTranslog Trimming and GC Logic Signed-off-by: Gaurav Bafna <gbbafna@amazon.com>
Signed-off-by: Gaurav Bafna gbbafna@amazon.com
Description
After any segment uploaded to remote store , we will update
minSeqNoRequired
forTranslog
. This is implemented only forRemoteFSTranslog
.minSeqNoRequired
will be used to preserve generations to be trimmed till it is uploaded to remote store.Once uploaded , post trimming, remote translog will be cleaned up as well along with local tlog files.
Issues Resolved
#5567
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.