[GENERAL] Synchronous Commit, WAL archiving and statement_timeout - Mailing list pgsql-general

From JP Jacoupy
Subject [GENERAL] Synchronous Commit, WAL archiving and statement_timeout
Date
Msg-id Sunq8Sm-AZC17UDIQPCztPHCbbrEmmT3RNmYGCq0h-uS6cKnQkEBegqdqbr9fPZnEa66ZO3ZTJeA01FTbEEklwqYqt_A1HAOB0Q4GUQcdr0=@protonmail.com
Whole thread Raw
Responses Re: [GENERAL] Synchronous Commit, WAL archiving and statement_timeout  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: [GENERAL] Synchronous Commit, WAL archiving and statement_timeout  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-general

Hello,

I noticed something strange and I would like to understand what's happening.

I have the following environment:
  - 2 PostgreSQL instance running in hot-standby with synchronous commit activated.
    (further called Master & Slave)
  - The archiving of the WAL files is activated on the master running every 5 minutes
  - Slave is down

I set the statement_timeout inside my ~/.psqlrc:
$ cat ~/.psqlrc
set statement_timeout = 1;
commit;

When running an UPDATE statement (via psql) on the master, it hangs (psql seems to
wait a response from the slave) ignoring any value I set in my .psqlrc and the update is
done and written on the Master. Furthermore if I try (doing the same things in a small
script with a timeout on the call to PQexec) to make a call to PQcancel it does nothing
on the Master.

I expected the statement to timeout because the synchronous_commit wouldn't work
since the Slave is down while rollbacking on the Master.

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: [GENERAL] (solved) R: Very strange problem on index
Next
From: John R Pierce
Date:
Subject: Re: [SPAM] [GENERAL] AD(Active Directory) groups concepts in postgres