Handle a catch-up request from a Lite peer. Delegates to [`OriginCatchupServer`] which validates the array, selects the op-stream or snapshot delivery path, and enqueues outbound frames.
(
&self,
msg: &ArrayCatchupRequestMsg,
session_id: &str,
)
| 279 | /// Delegates to [`OriginCatchupServer`] which validates the array, selects |
| 280 | /// the op-stream or snapshot delivery path, and enqueues outbound frames. |
| 281 | pub fn handle_catchup_request( |
| 282 | &self, |
| 283 | msg: &ArrayCatchupRequestMsg, |
| 284 | session_id: &str, |
| 285 | ) -> Result<InboundOutcome, Option<ArrayRejectMsg>> { |
| 286 | use super::catchup::OriginCatchupServer; |
| 287 | |
| 288 | let server = OriginCatchupServer::new( |
| 289 | Arc::clone(&self.shared.array_sync_op_log), |
| 290 | Arc::clone(&self.schemas), |
| 291 | Arc::clone(&self.shared.array_snapshot_store), |
| 292 | Arc::clone(&self.shared.array_delivery), |
| 293 | Arc::clone(&self.shared.array_subscriber_cursors), |
| 294 | Arc::clone(&self.shared.array_ack_registry), |
| 295 | ); |
| 296 | |
| 297 | if let Err(e) = server.serve(msg, session_id) { |
| 298 | warn!( |
| 299 | session = %session_id, |
| 300 | array = %msg.array, |
| 301 | error = %e, |
| 302 | "array_inbound: catchup server error" |
| 303 | ); |
| 304 | } |
| 305 | |
| 306 | Ok(InboundOutcome::CatchupRequested) |
| 307 | } |
| 308 | |
| 309 | // ─── Internal helpers ───────────────────────────────────────────────────── |
| 310 |
no test coverage detected