Is a logical replication crash recovery safe?
On Jan 24, 2023, at 07:37, Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch> wrote:
Is a logical replication crash recovery safe?
You might want to give more detail about the scenario you are concerned about. Changes that are received by a subscriber as part of logical replication are WAL-logged, observe transaction semantics, and will be replayed if the subscriber crashes and restarts.
-----Ursprüngliche Nachricht-----
Von: Christophe Pettus <xof@thebuild.com>
Gesendet: Dienstag, 24. Januar 2023 16:48
An: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
Cc: pgsql-general@lists.postgresql.org
Betreff: [Extern] Re: Is a logical replication crash recovery safe?On Jan 24, 2023, at 07:37, Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
wrote:
Is a logical replication crash recovery safe?
You might want to give more detail about the scenario you are concerned about.
Changes that are received by a subscriber as part of logical replication are WAL-
logged, observe transaction semantics, and will be replayed if the subscriber
crashes and restarts.
Sorry. Let me refine.
If I create a logical replication slot and use the replication slot to publish some tables.
Will the information in the replication slot be safe for any subscription even if a crash recovery happened on the publisher node?
Markus,
Yesterday EDB published the (open source) pg_failover_slots extension,
aimed at pushing logical slot information on standbys: without it, that
information is kept on the master only, so you have to rebuild the logical
replication topology on switch/fail-overs.
Obviously, if the promoted server is outdated wrt to the lost master, you
could still have problems with subscriptions, although there some
configuration that tries to address that problem too
(standby_slots_min_confirmed).
For the moment being you can find the documentation at EDB's docs
<https://www.enterprisedb.com/docs/pg_extensions/pg_failover_slots>, and
the sources at github.com/EnterpriseDB/pg_failover_slots. I hope the
extension will make quickly its way to PGDG as prebuilt packages.
Best,
g
On Tue, 24 Jan 2023 at 17:08, Zwettler Markus (OIZ) <
Markus.Zwettler@zuerich.ch> wrote:
Show quoted text
-----Ursprüngliche Nachricht-----
Von: Christophe Pettus <xof@thebuild.com>
Gesendet: Dienstag, 24. Januar 2023 16:48
An: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
Cc: pgsql-general@lists.postgresql.org
Betreff: [Extern] Re: Is a logical replication crash recovery safe?On Jan 24, 2023, at 07:37, Zwettler Markus (OIZ) <
Markus.Zwettler@zuerich.ch>
wrote:
Is a logical replication crash recovery safe?
You might want to give more detail about the scenario you are concerned
about.
Changes that are received by a subscriber as part of logical replication
are WAL-
logged, observe transaction semantics, and will be replayed if the
subscriber
crashes and restarts.
Sorry. Let me refine.
If I create a logical replication slot and use the replication slot to
publish some tables.Will the information in the replication slot be safe for any subscription
even if a crash recovery happened on the publisher node?