Skip to main content

Module logical

Module logical 

Source
Expand description

Logical replication helpers shared by replica apply and point-in-time restore.

Structs§

LogicalChangeApplier
Shared logical change applier so replica replay and PITR converge on the same semantics. Stateful (PLAN.md Phase 11.5): tracks the last applied LSN + payload hash so duplicates / older LSNs / gaps / divergences are detected explicitly.
ReplicaApplyMetrics
PLAN.md Phase 11.5 — counters the replica apply loop bumps when an invariant breaks. Surfaced via reddb_replica_apply_errors_total. Decode errors aren’t strictly apply errors but they share the same observability lane so dashboards alert on “replica is ingesting trash from primary regardless of cause”.

Enums§

ApplyErrorKind
ApplyMode
ApplyOutcome
Outcome of a single apply call. Applied advances the chain; Idempotent and Skipped are no-ops (we already saw an equal-or-newer LSN). Gap and Divergence (returned via LogicalApplyError) are fail-closed — callers (replica fetcher, restore loop) should mark the instance unhealthy and stop applying.
LogicalApplyError