mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Add option to control snapshot export to CREATE_REPLICATION_SLOT
We used to export snapshots unconditionally in CREATE_REPLICATION_SLOT in the replication protocol, but several upcoming patches want more control over what happens. Suppress snapshot export in pg_recvlogical, which neither needs nor can use the exported snapshot. Since snapshot exporting can fail this improves reliability. This also paves the way for allowing the creation of replication slots on standbys, which cannot export snapshots because they cannot allocate new XIDs. Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
This commit is contained in:
@ -271,8 +271,9 @@ $ pg_recvlogical -d postgres --slot test --drop-slot
|
||||
<sect2>
|
||||
<title>Exported Snapshots</title>
|
||||
<para>
|
||||
When a new replication slot is created using the streaming replication interface,
|
||||
a snapshot is exported
|
||||
When a new replication slot is created using the streaming replication
|
||||
interface (see <xref linkend="protocol-replication-create-slot">), a
|
||||
snapshot is exported
|
||||
(see <xref linkend="functions-snapshot-synchronization">), which will show
|
||||
exactly the state of the database after which all changes will be
|
||||
included in the change stream. This can be used to create a new replica by
|
||||
@ -282,6 +283,12 @@ $ pg_recvlogical -d postgres --slot test --drop-slot
|
||||
database's state at that point in time, which afterwards can be updated
|
||||
using the slot's contents without losing any changes.
|
||||
</para>
|
||||
<para>
|
||||
Creation of a snapshot is not always possible. In particular, it will
|
||||
fail when connected to a hot standby. Applications that do not require
|
||||
snapshot export may suppress it with the <literal>NOEXPORT_SNAPSHOT</>
|
||||
option.
|
||||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
Reference in New Issue
Block a user