[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.
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 |
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❌ Patch coverage is Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.