-
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
[Backport 2.x] [Segment Replication] Added source-side classes for orchestrating replication events. #4128
[Backport 2.x] [Segment Replication] Added source-side classes for orchestrating replication events. #4128
Conversation
…lication events (opensearch-project#3470) This change expands on the existing SegmentReplicationSource interface and its corresponding Factory class by introducing an implementation where the replication source is a primary shard (PrimaryShardReplicationSource). These code paths execute on the target. The primary shard implementation creates the requests to be send to the source/primary shard. Correspondingly, this change also defines two request classes for the GET_CHECKPOINT_INFO and GET_SEGMENT_FILES requests as well as an abstract superclass. A CopyState class has been introduced that captures point-in-time, file-level details from an IndexShard. This implementation mirrors Lucene's NRT CopyState implementation. Finally, a service class has been introduce for segment replication that runs on the source side (SegmentReplicationSourceService) which handles these two types of incoming requests. This includes private handler classes that house the logic to respond to these requests, with some functionality stubbed for now. The service class also uses a simple map to cache CopyState objects that would be needed by replication targets. Unit tests have been added/updated for all new functionality. Signed-off-by: Kartik Ganesh <gkart@amazon.com>
…is a breaking change and fix other uses of getProcessedLocalCheckpoint() Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
}); | ||
} | ||
|
||
private Optional<NRTReplicationEngine> getReplicationEngine() { |
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 method is not part of actual PR. But to fix the breaking change and write getProcessedLocalCheckpoint() in Indexshard.java in a cleaner way. This method is picked from another Segment Replication PR, which will be backported later. While backporting with PR, we should not include getReplicationEngine() in IndexShard.java
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
Wouldn't it be cleaner/easier to have the OpenSearch/server/src/test/java/org/opensearch/index/engine/ReadOnlyEngineTests.java Line 61 in fbe93d4
|
Yes, I will change this next commit. |
Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## 2.x #4128 +/- ##
============================================
+ Coverage 70.47% 70.53% +0.06%
- Complexity 56648 56686 +38
============================================
Files 4553 4559 +6
Lines 272795 272921 +126
Branches 40049 40053 +4
============================================
+ Hits 192240 192510 +270
+ Misses 64450 64267 -183
- Partials 16105 16144 +39
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Description
This PR backports b902add from #3470 and fixes breaking change in Engine.java
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.