Re: invisible commit question for sync replication

2023-02-01 Thread qihua wu
In the code it will write a warning to postgresql log. Why not also write the detailed sql? with the exact sql, DBA might do something to fix the issue. if (ProcDiePending) { ereport(WARNING, (errcode(ERRCODE_ADMIN_SHUTDOWN), errmsg("canceling the wait for synchronous replication and term

Re: invisible commit question for sync replication

2023-02-01 Thread Laurenz Albe
On Wed, 2023-02-01 at 14:52 +0800, qihua wu wrote: > When run a cluster with sync replication, if DML is done on primary, but > primary is > isolated from all slave, then the DML will hang, if cancel it DML, it will > say: > WARNING:  canceling wait for synchronous replication due to user request

Re: invisible commit question for sync replication

2023-02-01 Thread qihua wu
==》Can the second session see the inserted row before you cancel the insert that is waiting for sync ack? The second session can NOT see the inserted row if the first session is still waiting for sync ACK. I checked the source code, it makes sense to me now: The waiting for sync ACK is called in E

Re: invisible commit question for sync replication

2023-01-31 Thread David G. Johnston
On Wednesday, February 1, 2023, Julien Rouhaud wrote: > Hi, > > On Wed, Feb 01, 2023 at 02:52:49PM +0800, qihua wu wrote: > > When run a cluster with sync replication, if DML is done on primary, but > > primary is isolated from all slave, then the DML will hang, if cancel it > > DML, it will say:

Re: invisible commit question for sync replication

2023-01-31 Thread Julien Rouhaud
Hi, On Wed, Feb 01, 2023 at 02:52:49PM +0800, qihua wu wrote: > When run a cluster with sync replication, if DML is done on primary, but > primary is isolated from all slave, then the DML will hang, if cancel it > DML, it will say: > WARNING: canceling wait for synchronous replication due to user

invisible commit question for sync replication

2023-01-31 Thread qihua wu
When run a cluster with sync replication, if DML is done on primary, but primary is isolated from all slave, then the DML will hang, if cancel it DML, it will say: WARNING: canceling wait for synchronous replication due to user request DETAIL: The transaction has already committed locally, but mi