Re: Queries in replica are failing - Mailing list pgsql-admin

From Matt Pearson
Subject Re: Queries in replica are failing
Date
Msg-id 3fe3d1ea-6bba-44bd-ac66-d8730d643fbe@pythian.com
Whole thread Raw
In response to Queries in replica are failing  (Siraj G <tosiraj.g@gmail.com>)
List pgsql-admin

Hi,

I would probably use "hot_standby_feedback" rather than change the delay parameters, unless you want to have the read replica (Standby) actually to operate some time behind the primary, for some reason (like having a copy of the data an hour old to fix mistakes on the primary).

https://postgresqlco.nf/doc/en/param/hot_standby_feedback/

The hot_standby_feedback parameter sends feedback to the primary, so the transaction is less likely to be cancelled.  The only draw back is that is can cause some bloat on the primary database.

Regards,

Matt


On 16/05/2024 13:01, Siraj G wrote:
Hello -

Queries in replica instance are failing with the error "cancelling statement due to conflict with recovery". I was checking two parameters (max_standby_archive_delay and max_standby_streaming_delay)  which may allow the queries to run within the time defined in those.

Is it recommended to set those? Is there any other suggestion to tackle this?

Regards
Siraj

--



pgsql-admin by date:

Previous
From: Siraj G
Date:
Subject: Queries in replica are failing
Next
From: ravi k
Date:
Subject: Replication slot dropped in Bidirection rep: column addition