Re: statement_timeout has no effect if sync standby is unavailable - Mailing list pgsql-admin

From Tom Lane
Subject Re: statement_timeout has no effect if sync standby is unavailable
Date
Msg-id 3123996.1698941333@sss.pgh.pa.us
Whole thread Raw
In response to Re: statement_timeout has no effect if sync standby is unavailable  (Nikhil Shetty <nikhil.dba04@gmail.com>)
Responses Re: statement_timeout has no effect if sync standby is unavailable
List pgsql-admin
Nikhil Shetty <nikhil.dba04@gmail.com> writes:
> I need to check the process state but statement_timeout should timeout such
> queries, no?

No, I don't think that should be the policy, and if it doesn't do so
now I'm content to leave it like that.  Once we have committed locally
and started to wait for a sync standby, we are between a rock and a
hard place: we can't back out the commit.  If we were to allow a
timeout error to occur, we'd have a choice of reporting that the
commit failed (a lie) or that it succeeded (also a lie, given that
the promise of sync commit is that we don't report commit until it's
persisted on the standby too).  Neither of these are preferable to
ignoring the timeout.

tl;dr: if your standby is not 100% reliable, enabling sync standby
is a poor choice.

            regards, tom lane



pgsql-admin by date:

Previous
From: Nikhil Shetty
Date:
Subject: Re: statement_timeout has no effect if sync standby is unavailable
Next
From: Ron
Date:
Subject: How to _not_ save startup options in postmaster.opts?