Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Segment Replication] Checkpoint Replay on Replica Shard #3658
[Segment Replication] Checkpoint Replay on Replica Shard #3658
Changes from 2 commits
b7c5d6d
fcdfbd1
72c36ee
666ef0c
d9b2e71
e0ec134
57afbd6
4322d35
40c454c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm a little concerned that this recursive call could lead to a long-running thread and/or function stack overflow. As a follow-up to this PR, we should look into wrapping checkpoint processing in a
Runnable
so we can execute it async from the new-checkpoint notification.cc @mch2
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.
any reason not to do this now? @Rishikesh1159 @kartg ? We had a similar implementation in the feature branch - https://github.com/opensearch-project/OpenSearch/blob/feature/segment-replication/server/src/main/java/org/opensearch/index/shard/IndexShard.java#L3683
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.
Ah, i didn't realize the POC had the threading in place. Yes, if we have prior art, we can pull it into this PR
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.
QQ: Do newer checkpoints supersede older checkpoints? What happens when the replication is slow is backlogged with too many checkpoints to process.
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.
Sure, I wrapped checkpoint processing in a Runnable in new commit
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.
@Bukhtawar we only store one latest received checkpoint and replace it whenever there is a new checkpoint. We don't store all received checkpoints to replica shard. So, even when replication is slow, we won't be backlogged with too many checkpoints, because we process only one checkpoint (which is latest received checkpoint)
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 and I am assuming replication usually happens on the
generic
threadpool to start with?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.
@Rishikesh1159, @mch2 I would recommend doing explicit checks rather than simply forking to guarantee we don't end up using the same thread
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.
@Rishikesh1159 : Will be good to have test cases for failure scenario, multiple checkpoints and IT exercising this code.
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.
We have already covered failure scenario in previous PR.For multiple checkpoints we are already passing 2 checkpoints in many of our tests, so not sure if there is need to multiple checkpoints test case, But if needed we can do that also. And for IT for this, yes it is good to have an IT for this code, but I think we can make a different PR for that