-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Segrep needs a service and handlers similar to PeerRecoveryTargetService to manage copying of segments between replicas and primaries.
The service should first fetch the latest checkpoint metadata from a primary shard and then kick off sending of segments back to the replica.
This is similar to the PrimaryShardReplicationSource code written as part of the POC. This POC code has a lot of duplication with PeerRecoveryTargetService, particularly in the endpoint to copy file chunks.
We will also need a service similar to PeerRecoverySourceService that handles requests from replicas. With Segment replication this source service would handle requests for new checkpoints (GET_CHECKPOINT in poc) and a handler for a request for files to be copied (GET_FILES in poc). Once a checkpoint request is received we need to incref the requested segments to ensure they are not merged away during a copy. The GET_FILES endpoint would start a copy process back to replicas, sending file chunks.