Synchronous logical replication

From: "asaba(dot)takanori(at)fujitsu(dot)com" <asaba(dot)takanori(at)fujitsu(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Synchronous logical replication
Date: 2021-09-21 07:29:07
Message-ID: OSBPR01MB1479CA0EDDFCE61DB201B51A8CA19@OSBPR01MB1479.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a question about synchronous logical replication.

There is the following description in the document "49.8. Synchronous Replication Support for Logical Decoding".
> A synchronous replica receiving changes via logical decoding will work in the scope of a single database.
> Since, in contrast to that, synchronous_standby_names currently is server wide,
> this means this technique will not work properly if more than one database is actively used.

What kind of problem will it occur?
For example,

publisher:
db1=# \dRp
List of publications
Name | Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root
-------------+----------+------------+---------+---------+---------+-----------+----------
pub1 | user | f | t | t | t | t | f
(1 row)

db2=# \dRp
List of publications
Name | Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root
-------------+----------+------------+---------+---------+---------+-----------+----------
pub2 | user | f | t | t | t | t | f
(1 row)

synchronous_standby_names = 'FIRST 2 (sub1, sub2)'

subscriber:
db1=# \dRs
List of subscriptions
Name | Owner | Enabled | Publication
-------------+--------+---------+---------------
sub1 | user | t | {pub1}
(1 row)

db2=# \dRs
List of subscriptions
Name | Owner | Enabled | Publication
-------------+--------+---------+---------------
sub2 | user | t | {pub2}
(1 row)

In the above example, will not synchronous replication for both sub1 and sub2 work?
Also, if sub2 is changed asynchronously, will any problem occur?

Regards,

--
Takanori Asaba

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2021-09-21 07:35:20 Re: Timestamp with vs without time zone.
Previous Message Laurenz Albe 2021-09-21 07:25:56 Re: Timestamp with vs without time zone.