statement_timeout has no effect if sync standby is unavailable

From: Nikhil Shetty <nikhil(dot)dba04(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: statement_timeout has no effect if sync standby is unavailable
Date: 2023-10-27 10:13:01
Message-ID: CAFpL5VwpZ3Ey3SL=rtXDSVo-PfYT1x6z+9z69Ssu72mCmW9_yA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Team,

I am writing a monitoring tool to find if the database is hung.

One of the scenarios is to stop the standby but keep
'synchronous_standby_names=standby1'
and 'synchronous_commit=remote_apply' unchanged on primary.

This way the DML queries on primary will be hung. I tried to use
'statement_timeout=5s'
to timeout the query but it does not work.

Is there another way to timeout query and report an error ? and why is
statement_timeout not working?

Thanks,
Nikhil

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message SOzcn 2023-10-27 10:36:53 On Replica - History issue
Previous Message B Liu 2023-10-27 08:14:50 pgagent for windows download link missing