Skip to main content

Module subscriptions

Module subscriptions 

Source
Expand description

v6.1.4 — logical-replication subscription catalog.

In-memory table of subscriptions, owned by the engine. The catalog persists across restarts via the snapshot envelope’s v4 trailer block (see crate::lib::build_envelope) — same mechanism v6.1.2 added for publications, just an extra section.

Subscriptions are the receive side of logical replication. A CreateSubscription row holds:

  • name the local identifier
  • conn_str PG keyword=value string the worker parses for host=… and port=…
  • publications list of remote publication names
  • enabled v6.1.4 hard-codes to true; ALTER SUBSCRIPTION ENABLE / DISABLE lands in a future sub-version
  • last_received_pos master-WAL byte offset the worker has applied through (updated live by the worker, persisted at the next snapshot)

The worker itself lives in spg-server::replication:: run_subscription_worker — the engine layer only owns the catalog state, snapshots, and answers SHOW SUBSCRIPTIONS.

Structs§

Subscription
Subscriptions

Enums§

SubscriptionError