MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / handle_ack

Method handle_ack

nodedb/src/control/array_sync/inbound.rs:260–273  ·  view source on GitHub ↗

Record a peer ack for GC frontier tracking. Forwards the ack into the `ArrayAckRegistry` on `SharedState` so the GC task can compute the min-ack frontier for each array.

(&self, msg: &ArrayAckMsg)

Source from the content-addressed store, hash-verified

258 /// Forwards the ack into the `ArrayAckRegistry` on `SharedState` so the
259 /// GC task can compute the min-ack frontier for each array.
260 pub fn handle_ack(&self, msg: &ArrayAckMsg) -> Result<InboundOutcome, Option<ArrayRejectMsg>> {
261 let ack_hlc = Hlc::from_bytes(&msg.ack_hlc_bytes);
262 let replica_id = nodedb_array::sync::replica_id::ReplicaId::new(msg.replica_id);
263 self.shared
264 .array_ack_registry
265 .record(&msg.array, replica_id, ack_hlc);
266 tracing::debug!(
267 array = %msg.array,
268 replica_id = msg.replica_id,
269 ack_hlc = ?ack_hlc,
270 "array_inbound: peer ack recorded"
271 );
272 Ok(InboundOutcome::AckRecorded)
273 }
274
275 // ─── Catchup request ─────────────────────────────────────────────────────
276

Callers 1

dispatch_array_frameFunction · 0.80

Calls 1

recordMethod · 0.45

Tested by

no test coverage detected