Re: Replication conflicts despite hot_standby_feedback = on?

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Replication conflicts despite hot_standby_feedback = on?
Date: 2020-06-03 11:41:23
Message-ID: CAOBaU_Y6ezV6BCMt7NFjPY-veDrX=MEkThza11T-CKGccyS8PQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 3, 2020 at 1:07 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:
>
> I'm seeing the following at a customer site:
>
> SELECT confl_tablespace, confl_lock, confl_snapshot, confl_bufferpin, confl_deadlock
> FROM pg_stat_database_conflicts
> WHERE datname = 'something' \gx
>
> -[ RECORD 1 ]----+------
> confl_tablespace | 0
> confl_lock | 0
> confl_snapshot | 84990
> confl_bufferpin | 0
> confl_deadlock | 0
>
> SHOW hot_standby_feedback;
>
> hot_standby_feedback
> ----------------------
> on
> (1 row)
>
> This is PostgreSQL 11.7, the standby didn't disconnect from the primary, and
> the number of replication conflicts is growing.
>
> I had thought that "hot_standby_feedback = on" would get rid of such
> conflicts.
>
> In the code I see a lot of call sites for ResolveRecoveryConflictWithSnapshot,
> so it is hard for me to track this down. Does anybody know what could cause
> these replication conflicts?

One of the frequent causes is the lock acquired by (auto)vacuum when
truncating the trailing empty blocks, maybe you can correlate your
conflicts with autovacuum activity?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleksandr Shulgin 2020-06-03 11:55:25 Re: When to use PARTITION BY HASH?
Previous Message Paul Bonaud 2020-06-03 11:11:12 Re: Fine grained permissions on User Mapping