Re: [HACKERS] Commits don't block for synchronous replication

2017-09-19 Thread Masahiko Sawada
On Tue, Sep 19, 2017 at 2:26 PM, Michael Paquier wrote: > On Tue, Sep 19, 2017 at 7:50 AM, Xin Zhang wrote: >> If primary crashed at that moment, and failover to standby, the foo table is >> lost, even though the replication is synced according to >>

Re: [HACKERS] Commits don't block for synchronous replication

2017-09-18 Thread Michael Paquier
On Tue, Sep 19, 2017 at 7:50 AM, Xin Zhang wrote: > If primary crashed at that moment, and failover to standby, the foo table is > lost, even though the replication is synced according to > `pg_stat_replication` view. GUC parameters are reloaded each time a query is run, and

[HACKERS] Commits don't block for synchronous replication

2017-09-18 Thread Xin Zhang
By setting up synchronized replication between primary and standby, commits on primary should be blocked by function `SyncRepWaitForLSN()` until its effects replicated to the standby. Currently, `SyncRepWaitForLSN()` fast exits if the `SyncStandbysDefined()` is false, which means GUC