barrel_rep_att (barrel_docdb v1.0.0)
View SourceThe attachment phase of a replication run. Runs AFTER the doc loop (independent lifecycles, independent checkpoint): fold the source's attachment feed since the attachment checkpoint, digest-diff each batch against the target in one round trip, stream the missing blobs (digest-verified at the target's commit point), apply LWW-guarded deletes, checkpoint per batch.
Degrades to skipped when either transport (or the underlying attachment backend) has no feed support. Redelivery is safe end-to-end: digest diff answers have, and the origin-HLC guard turns replays into {ok, ignored}.
Summary
Functions
Run the attachment phase from an explicit since with a caller-supplied checkpoint fun (invoked with the last visited feed HLC after each batch, and once more on completion). This is the timeline merge entry point; sync/5 wraps it with the replication-checkpoint machinery.
Types
-type att_info() :: #{name := binary(), content_type := binary(), length := non_neg_integer(), digest := binary(), chunked => boolean(), chunk_size => pos_integer(), chunk_count => pos_integer()}.
-type change() :: map().
-type db_name() :: binary().
-type docid() :: binary().
-type revid() :: binary().
-type seq() :: barrel_hlc:timestamp().
-type seq_string() :: binary().
-type view_name() :: binary().
Functions
-spec sync_from(term(), term(), module(), module(), barrel_hlc:timestamp() | first, fun((barrel_hlc:timestamp() | first) -> ok), map()) -> {ok, map()} | skipped | {error, term()}.
Run the attachment phase from an explicit since with a caller-supplied checkpoint fun (invoked with the last visited feed HLC after each batch, and once more on completion). This is the timeline merge entry point; sync/5 wraps it with the replication-checkpoint machinery.