Upgrade a replication pipeline

Copy Markdown View Source

Use this guide when upgrading Replicant, its PostgreSQL source, or the output plugin. For a source or plugin cutover, preserve the checkpoint on the same source.

Migrate backpressure alerts

  • Replace :sink_too_slow alerts with [:replicant, :connection, :stalled]. The event reports outstanding assembler work with no completed frames for five seconds, whether intake is paused or still receiving.
  • Treat [:replicant, :connection, :disconnected] as a connection signal with empty measurements and metadata. For stalled work, use the duration, change_count, and byte_size from the :stalled event.
  • Size max_inflight_lag for queued payload and retained transaction data. Monitor PostgreSQL slot retention using pg_replication_slots.restart_lsn and source disk usage. Set max_slot_wal_keep_size to the source's retention budget. Exceeding that limit can invalidate a lagging slot at a checkpoint.
  • Use the recovery guide for a slot invalidation or retained payload exhaustion.

Change the PostgreSQL source version or output plugin

  1. Check compatibility before upgrading the server or starting the pipeline against it.
  2. Replace decoder: :wal2json and its tables:, allow_keyless_tables: and schema_check_interval: options with a pgoutput configuration. Create a publication and verify its table and operation coverage. A pglogical pipeline keeps replication_sets:.
  3. Quiesce writes to the source, drain the old pipeline through its last committed change, and persist its checkpoint. Create a new pgoutput slot while writes are quiesced. A logical slot keeps its original output plugin.
  4. Confirm the new slot's consistent point covers the cutover and reconcile it with the sink's checkpoint before resuming writes and consumption. Keep checkpoint positions bound to their source and leave unverified WAL intervals unacknowledged.

For a state mirror, a fresh snapshot can rebuild current state. For an append log, preserve the prior history through the handoff or reconcile it using independently retained records before advancing the checkpoint. See ADR-0010 for the support decision and snapshot coverage for backfill behavior.