SiphonLogicalReplicationSlotInactive
Overview
Section titled “Overview”This alert fires when no walsender has read a Siphon logical replication slot on a GitLab.com Patroni primary for 15 minutes: the slot’s producer is not replicating at all.
A running producer holds its slot, including in failover (emergency) mode, and a restart or deploy reconnects within seconds. Fifteen minutes without a reader usually means the producer is down, crash-looping, scaled to zero, or failing before it starts replicating, for example while it sets up NATS or connects to PostgreSQL.
The exception is the drain after a NATS outage. When NATS is back, the producer leaves failover mode, replays what it buffered in the failover store to NATS, and only then reconnects to the slot. A drain that runs longer than 15 minutes fires this alert on a healthy producer. The slot really is unread then, so WAL builds up on the primary until the drain finishes. See Draining after a NATS outage.
It fires well before SiphonLogicalReplicationSlotLagHigh, which waits for 100 GiB of unconfirmed WAL. In siphon#383 that took about 35 minutes. It doesn’t fire for a producer that holds its slot without advancing it; the lag alert covers that.
Services
Section titled “Services”- Siphon Service
- Team that owns the service: Platform Insights
- Upstream: the Patroni Service. The unread slot
retains WAL on the primary in the alert’s
fqdnlabel.
Metrics
Section titled “Metrics”pg_replication_slots_activefrompostgres_exporteron the Patroni hosts, in thegitlab-gprdandgitlab-gstgMimir tenants. It is 1 while a walsender holds the slot.- Restricted to Patroni primaries (
type=~"patroni.*"andpg_replication_is_replica == 0), and to slots matching.*siphon.*but not.*siphon_backup.*, like the lag alert. for: 15m. A single read inside the window starts it over.
Alert Behavior
Section titled “Alert Behavior”- Severity:
s2, and it pages through PagerDuty (pager: pagerduty), like the 100 GiB lag alert. - Expected frequency: rare. A planned producer stop longer than 15 minutes fires it; silence it for the duration. So does a drain longer than 15 minutes after a NATS outage.
- It clears as soon as the producer reads the slot again.
Verification
Section titled “Verification”-
Siphon Producers dashboard:
siphon_operations_totalflat for the affected application. -
On the primary,
activeisfandactive_pidis empty for the slot:SELECT slot_name, active, active_pid,pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), confirmed_flush_lsn)) AS lagFROM pg_replication_slotsWHERE slot_type = 'logical' AND slot_name ILIKE '%siphon%';
Troubleshooting
Section titled “Troubleshooting”Follow High logical replication lag / producer not running in the Siphon runbook. In short:
-
Find the affected DB from
slot_name:prd_main_siphon_slot_1→main,prd_ci_siphon_slot_1→ci,prd_sec_siphon_slot_1→sec. -
Check the producer pods and logs on
orbit-prd(ororbit-stg):Terminal window kubectl get pods -n siphon -o widekubectl logs -n siphon -l app=postgres-<db>-producer --tail=200A producer that keeps logging
siphon producer failed, restarting...is failing before replication starts; the error after it names the cause, often NATS (see the NATS runbook) or PostgreSQL connectivity. A producer loggingdraining failover storeandfailover object drainedis draining; see below. -
Restart the producer once the cause is fixed. This is safe: it resumes from the slot.
Terminal window kubectl rollout restart deployment/postgres-<db>-producer -n siphon
Draining after a NATS outage
Section titled “Draining after a NATS outage”The producer is draining if, right after a NATS outage:
- it logged
NATS recovered; exiting failover mode and restarting siphon core, thendraining failover storeandfailover object drainedlines; - “Drained messages after emergency mode” on the
Siphon Producers dashboard
is rising, and the backlog
siphon_failover_writes_total - siphon_failover_drain_published_totalis falling.
Let the drain finish. A restart doesn’t speed it up: the drain picks up where
it stopped. The alert clears when the producer reconnects to the slot. If the
backlog stops falling or siphon_failover_drain_errors_total rises, follow
NATS unavailable (producer in emergency mode)
in the Siphon runbook.
Escalation
Section titled “Escalation”#g_analytics_platform_insightson Slack (team handbook).- If WAL retention puts the primary at risk, escalate to
#database_operationsas for SiphonLogicalReplicationSlotLagHigh.