Commit c66fb78e authored by Amit Kapila's avatar Amit Kapila

Doc: Update caveats in synchronous logical replication.

Reported-by: Simon Riggs
Author: Takamichi Osumi
Reviewed-by: Amit Kapila
Backpatch-through: 9.6
Discussion: https://www.postgresql.org/message-id/20210222222847.tpnb6eg3yiykzpky@alap3.anarazel.de
parent a443c1b2
...@@ -1097,16 +1097,18 @@ OutputPluginWrite(ctx, true); ...@@ -1097,16 +1097,18 @@ OutputPluginWrite(ctx, true);
<para> <para>
In synchronous replication setup, a deadlock can happen, if the transaction In synchronous replication setup, a deadlock can happen, if the transaction
has locked [user] catalog tables exclusively. This is because logical decoding of has locked [user] catalog tables exclusively. See
transactions can lock catalog tables to access them. To avoid this users <xref linkend="logicaldecoding-capabilities"/> for information on user
must refrain from taking an exclusive lock on [user] catalog tables. This can catalog tables. This is because logical decoding of transactions can lock
happen in the following ways: catalog tables to access them. To avoid this users must refrain from taking
an exclusive lock on [user] catalog tables. This can happen in the following
ways:
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
Issuing an explicit <command>LOCK</command> on <structname>pg_class</structname> Issuing an explicit <command>LOCK</command> on <structname>pg_class</structname>
(or any other catalog table) in a transaction. in a transaction.
</para> </para>
</listitem> </listitem>
...@@ -1141,6 +1143,10 @@ OutputPluginWrite(ctx, true); ...@@ -1141,6 +1143,10 @@ OutputPluginWrite(ctx, true);
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
Note that these commands that can cause deadlock apply to not only explicitly
indicated system catalog tables above but also to any other [user] catalog
table.
</para> </para>
</sect2> </sect2>
</sect1> </sect1>
...@@ -1311,7 +1317,7 @@ stream_commit_cb(...); &lt;-- commit of the streamed transaction ...@@ -1311,7 +1317,7 @@ stream_commit_cb(...); &lt;-- commit of the streamed transaction
[user] catalog tables exclusively. To avoid this users must refrain from [user] catalog tables exclusively. To avoid this users must refrain from
having locks on catalog tables (e.g. explicit <command>LOCK</command> command) having locks on catalog tables (e.g. explicit <command>LOCK</command> command)
in such transactions. in such transactions.
(See <xref linkend="logicaldecoding-synchronous-caveats"/> for the details.) See <xref linkend="logicaldecoding-synchronous-caveats"/> for the details.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment