pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nikhil Shetty <nikhil.dba04@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: statement_timeout has no effect if sync standby is unavailable
Date: Thu, 02 Nov 2023 12:08:53 -0400
Message-ID: <3123996.1698941333@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFpL5VwFGojDpgaN18c1v-y2XLRRJMrDRU7ZgtXovz-zV0P3Tw@mail.gmail.com>
References: <CAFpL5VwpZ3Ey3SL=rtXDSVo-PfYT1x6z+9z69Ssu72mCmW9_yA@mail.gmail.com>
	<CAFpL5VzcQXxzbzkVAnRM87qVZnZX4VYh1YcWZVMqSz+jH2AErw@mail.gmail.com>
	<e73f7d44c3f76455519b2286eef19b1d42d4884d.camel@cybertec.at>
	<CAFpL5VwFGojDpgaN18c1v-y2XLRRJMrDRU7ZgtXovz-zV0P3Tw@mail.gmail.com>

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





view thread (6+ messages)  latest in thread

Message-ID: <3123996.1698941333@sss.pgh.pa.us>
Permalink:  ../3123996.1698941333@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3123996.1698941333@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, nikhil.dba04@gmail.com, laurenz.albe@cybertec.at, pgsql-admin@lists.postgresql.org
  Subject: Re: statement_timeout has no effect if sync standby is unavailable
  In-Reply-To: <3123996.1698941333@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox