Recover a stalled or halted pipeline

Copy Markdown View Source

Use this guide when a pipeline stops delivering. Read the reason in Replicant.Telemetry and restore the conditions that let the pipeline resume from its durable checkpoint. A permanent halt requires an explicit restart.

SignalCauseBefore restarting
[:replicant, :sink, :failed]Sink callback fails.Restore the destination and confirm the durable checkpoint.
:buffer_limit_exceededRetained transaction payload exceeds the budget.Reduce transaction size, enable pgoutput streaming with spill, or raise max_inflight_lag within available memory.
[:replicant, :connection, :slot_invalidated]The slot is lost or the source refuses replication with the requested settings.Check the structural reason. Recover missing source coverage or reconcile the slot with the sink before resuming.
[:replicant, :connection, :command_error_halt]A pre-frame replication command exhausts its connect-cycle budget.Check available slots, active consumers and server compatibility.
:session_identity_rejectedThe sink vetoes the actual replication session.Point at the intended source or verify continuity before changing the accepted identity.
:slot_origin_rejected or :slot_origin_unavailableAn append sink vetoes the origin, or slot origin state is missing or malformed.Reconcile the append log with the origin before replay.
[:replicant, :checkpoint_store, :failed]Retry budget expires, or a permanent store fault occurs.Restore the store or correct its schema or configuration.
[:replicant, :schema_change, :halted]The source shape changes destructively.Adapt the sink. Use Replicant.Sink.handle_schema_change/2 to admit the new shape only when the sink can apply it.
:snapshot_table_contendedA snapshot window exhausts its contention attempts.Backfill during a quieter period, or reduce chunk_rows for a keyed table.
:snapshot_column_list_conflictRequested publications or replication sets disagree on a table's projection.Align the lists. Verify that any incomplete initial snapshot is safe to discard before recreating its slot.
[:replicant, :snapshot, :failed] with :snapshot_no_publishable_columnsA table with columns has no stream-visible projection.Publish at least one stream-visible column. The event names the table.
[:replicant, :snapshot, :failed] (other)Snapshot reading fails.Check source connectivity and resume from the durable progress token if using incremental mode.
[:replicant, :stream, :spill_exhausted]Spill reaches the configured disk ceiling.Free disk, resize the ceiling, or reduce the source transaction size.
:decode_failureMalformed input reaches the decoder or caster.Check the WAL and source plugin. Keep payloads out of diagnostics.
:decoder_protocol_unsupported or :decoder_option_unsupportedThe installed plugin rejects the required protocol or startup options.Install a compatible build.
:decoder_table_missingA discovered pglogical replication-set table is absent.Restore the table or correct the set.
:server_version_unsupported or :failover_unsupportedThe source version cannot support the requested pipeline.Check compatibility.
:slot_synced_unpromotedA synced failover slot belongs to an unpromoted standby.Wait for promotion or connect to the primary.

If the slot no longer covers the durable checkpoint, verify what the sink misses before starting a replacement. A current-state mirror can use a fresh snapshot. Preserve or reconstruct missing append-log history from retained records before moving its checkpoint.

Understand the retry budgets

max_command_retries counts failed connection cycles before the stream establishes. A zero budget halts on the first qualifying fault. The first replication frame resets the count. A transport that never establishes a connection keeps retrying under the connection policy.

The checkpoint store has its own max_retries and retry_backoff_ms options. Transient reads cause paced reconnects. Transient writes block the applier while the store retries. Permanent schema or configuration faults halt immediately. A zero budget disables retries. Each retry emits [:replicant, :checkpoint_store, :retrying].

If Replicant.start_link/1 returns an error before creating a pipeline, correct the option or callback reported by Replicant.Config.validate/1 and try again.

Investigate stalled delivery

Use [:replicant, :connection, :stalled] to find queued work that has made no progress for five seconds. Check the sink callback and its destination. During a pause the pipeline retains slot ownership and acknowledges its durable checkpoint. Monitor WAL retention separately, as described in the upgrade guide.

Recover a silent stream

Set receive_timeout in Replicant.start_link/1 to enable automatic recovery. The watchdog runs during unpaused streaming. It stays idle during the connect checks, assembler retirement, and an exported snapshot. The probe reports the durable checkpoint and asks PostgreSQL for a keepalive. See the option reference for how the effective session wal_sender_timeout sets the minimum receive deadline.

After a timeout, the replacement session checks the source and the slot. If another backend still holds the slot, Replicant checks once per second and emits [:replicant, :connection, :slot_release_wait]. It resumes from the durable checkpoint once the slot is free. This wait leaves max_command_retries available for command failures.

When wal_sender_timeout is zero, the source may hold the old connection indefinitely. Replicant logs a warning when the wait starts. Check pg_replication_slots.active_pid and confirm which session holds the slot before releasing it. A missing or invalidated slot requires the recovery steps above.