Re: Issue with logical replication slot during switchover - Mailing list pgsql-hackers

From Alexander Kukushkin
Subject Re: Issue with logical replication slot during switchover
Date
Msg-id CAFh8B==6GzSt_8eSuZdPcmeH9xackqOsYfQKVbRcWGKtXYkNfQ@mail.gmail.com
Whole thread Raw
In response to Re: Issue with logical replication slot during switchover  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Issue with logical replication slot during switchover
List pgsql-hackers


But the system can die/crash before shutdown.

You mean it will not write WAL?
When a logical replication slot is created we build a snapshot and also write to WAL:
postgres=# select pg_current_wal_insert_lsn(); select pg_create_logical_replication_slot('foo', 'pgoutput'); select pg_current_wal_insert_lsn();
 pg_current_wal_insert_lsn
---------------------------
 0/37F96F8
(1 row)

 pg_create_logical_replication_slot
------------------------------------
 (foo,0/37F9730)
(1 row)

 pg_current_wal_insert_lsn
---------------------------
 0/37F9730
(1 row)

Only after that slot is marked as persistent.

Regards,
--
Alexander Kukushkin

pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Consistently use the XLogRecPtrIsInvalid() macro
Next
From: Daniel Gustafsson
Date:
Subject: Re: pg_getaddrinfo_all() with hintp=NULL