Synchronous Commit, WAL archiving and statement_timeout

From: JP Jacoupy <jpjacoupy(at)protonmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Synchronous Commit, WAL archiving and statement_timeout
Date: 2017-02-02 17:15:43
Message-ID: Sunq8Sm-AZC17UDIQPCztPHCbbrEmmT3RNmYGCq0h-uS6cKnQkEBegqdqbr9fPZnEa66ZO3ZTJeA01FTbEEklwqYqt_A1HAOB0Q4GUQcdr0=@protonmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-02-02 18:38:45 Re: [SPAM] AD(Active Directory) groups concepts in postgres
Previous Message Alban Hertroys 2017-02-02 16:46:36 Re: (solved) R: Very strange problem on index