| From: | Imran Khan <imran(dot)k(dot)23(at)gmail(dot)com> |
|---|---|
| To: | Ishan joshi <ishanjoshi(at)live(dot)com> |
| Cc: | pgsql-admin <pgsql-admin(at)postgresql(dot)org> |
| Subject: | Re: canceling/terminating statement due to conflict with recovery in Replica/DR instances |
| Date: | 2025-09-30 12:36:48 |
| Message-ID: | CAC4eXDhX7Zw5w8Z52USrCZFT6W8y30nZaaouwTtW0COb=cvtzQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
Hi Isha,
I believe you have partitions and correct type of indexes created for
those tables. Also, is this 25 TB size grown over many years or just few
years old? Parameters tuning can help but won't be a permanent solution.
Having multiple replicas I believe can make sense at this point.
Thanks,
Imran
On Tue, Sep 30, 2025, 8:59 AM Ishan joshi <ishanjoshi(at)live(dot)com> wrote:
> Hi Team,
>
> We are using Postgresql 16.9 in production and with large database about
> 25TB of size. We have patroni setup with replica instance and DR patroni
> setup with patroni streaming.
>
> We have high volume and frequent commit in the database. There are few
> large tables for which we asked client to execute queries on DR/Replica
> instances but these queries are start getting failed with "canceling
> statement due to conflict with recovery" and "terminating statement due to
> conflict with recovery" error.
>
> As I understand the behavior is correct but we need to get rid of this
> issue.
>
> I gone through the old posts and some documentation and got to know that
> below parameters can help to reduce this error.
>
> max_standby_streaming_delay
> max_standby_archive_delay
> hot_standby_feedback = off
>
> Our queries are running for long period that makes me to set this value to
> some minutes/hours (lets set 900s) which is not feasible for production as
> it will start impacting the replication lag. Also, the queries will fail if
> it reaches to mentioned thresholds.
>
> If I set these parameters to "-1" (disable) then there will be direct
> impact on replication lag which will impact further queries on replica node
> and DR cluster.
>
> Can you please guide If any other better solution present for such
> scenario?
>
> Thanks & Regards,
> Ishan Joshi
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ron Johnson | 2025-09-30 13:16:10 | Re: Necessary actions after an OS upgrade |
| Previous Message | Troels Arvin | 2025-09-30 12:06:24 | Windows Server 2025 status? |