Summary
A Lite replica can push document CRDT deltas to Origin and they are accepted (acked, server LSN advances, a CRDT checkpoint is persisted) — but the data never becomes servable: a fresh Lite shape-subscribing the same collection gets an initial ShapeSnapshot with doc_count=0. So the lite->Origin push path works, but the Origin->lite serve path returns nothing. The round-trip (write on one replica -> read on another via Origin) does not complete.
Repro
- Origin running (trust auth), sync WS on
:9090.
- From a Lite replica, write ~1,537 documents into collection
entries with sync enabled. Observe in the Lite log: pushed deltas to Origin, delta acknowledged rtt_ms~8, FtsIndexAck ... accepted=true for every doc.
- From a fresh Lite replica,
ShapeSubscribe { ShapeType::Document { collection: "entries", predicate: [] } }.
Observed: ShapeSnapshot { doc_count: 0, snapshot_lsn: 3577, data: [1 byte] } — identical for tenant_id 0, 1, and 2.
Evidence the pushes were received
- Origin
snapshot_lsn = 3577 (advanced from the pushes).
/data/<inst>/crdt-ckpt/tenant-tenant:0.ckpt ~= 20 MB, written right after the sync.
- Every delta was acked back to the pusher.
Evidence the collection is not served
SHOW COLLECTIONS on Origin -> 0 rows. SELECT ... FROM entries -> "table not found".
- Round-trip
ShapeSnapshot.doc_count = 0 in all tenants.
Is this expected / known?
The repo's own interop test acknowledges the serve side is stubbed — nodedb-lite/tests/sync_interop_shape.rs:137:
"Origin does not currently fan-out ShapeDelta back over the same connection as the delta pusher. We simulate Origin's fan-out by directly feeding a ShapeDelta frame through the SyncClient handler..."
Two questions:
- Is Origin-side materialization of pushed document deltas into a servable collection implemented for 0.1.0, or known-unimplemented?
- Is the intended flow that the collection must be created on Origin first (DDL) before Lite pushes/subscribes? If so it isn't documented; if not, pushed deltas aren't being materialized.
Scope note
The CRDT protocol itself is solid — handshake, real Loro delta push, ack, reconnect, and the sync_interop_live suite all pass against a real Origin. This is specifically about the serve/materialize half of lite<->Origin document sync.
Summary
A Lite replica can push document CRDT deltas to Origin and they are accepted (acked, server LSN advances, a CRDT checkpoint is persisted) — but the data never becomes servable: a fresh Lite shape-subscribing the same collection gets an initial
ShapeSnapshotwithdoc_count=0. So the lite->Origin push path works, but the Origin->lite serve path returns nothing. The round-trip (write on one replica -> read on another via Origin) does not complete.Repro
:9090.entrieswith sync enabled. Observe in the Lite log:pushed deltas to Origin,delta acknowledged rtt_ms~8,FtsIndexAck ... accepted=truefor every doc.ShapeSubscribe { ShapeType::Document { collection: "entries", predicate: [] } }.Observed:
ShapeSnapshot { doc_count: 0, snapshot_lsn: 3577, data: [1 byte] }— identical fortenant_id0, 1, and 2.Evidence the pushes were received
snapshot_lsn= 3577 (advanced from the pushes)./data/<inst>/crdt-ckpt/tenant-tenant:0.ckpt~= 20 MB, written right after the sync.Evidence the collection is not served
SHOW COLLECTIONSon Origin -> 0 rows.SELECT ... FROM entries-> "table not found".ShapeSnapshot.doc_count= 0 in all tenants.Is this expected / known?
The repo's own interop test acknowledges the serve side is stubbed —
nodedb-lite/tests/sync_interop_shape.rs:137:Two questions:
Scope note
The CRDT protocol itself is solid — handshake, real Loro delta push, ack, reconnect, and the
sync_interop_livesuite all pass against a real Origin. This is specifically about the serve/materialize half of lite<->Origin document sync.