xataio/pgstream

Add phase visibility for `snapshot_and_replication` mode

Geschlossen

#984 geöffnet am 09.07.2026

 (1 Kommentar) (1 Reaktion) (0 zugewiesene Personen)Go (66 Forks)auto 404
good first issuereplicationsnapshot

Repository-Metriken

Stars
 (1.151 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Problem

In snapshot_and_replication mode, there's no queryable way to tell whether the process is doing the initial snapshot or logical replication. The only signal is the ordered log sequence: initial snapshot enabled → snapshot generation completed → logical replication started.

pgstream status doesn't help: it's a static config/init check against Postgres (not the running process), and its Status struct has no phase field.

Proposal

Expose the current phase (snapshot | replication) as a queryable signal. Preferred: a /status endpoint on the existing health server (cmd/health_cmd.go:32), and OTel phase gauge, or enriching pgstream status to read slot active/confirmed_flush_lsn.

Requirements

  • Operator can tell snapshot vs streaming phase without reading logs.
  • Signal flips at logical replication started.
  • Works for all pgstream modes, not just snapshot_and_replication

Contributor Guide