Re: [HACKERS] Replication slots and isolation levels - Mailing list pgsql-admin

From Michael Paquier
Subject Re: [HACKERS] Replication slots and isolation levels
Date
Msg-id CAB7nPqTSVXR1WQegikpnkATjR3oz8FQE3hUf9RUk+o9VN0+zrQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Replication slots and isolation levels  (Vladimir Borodin <root@simply.name>)
Responses Re: [HACKERS] Replication slots and isolation levels  (Vladimir Borodin <root@simply.name>)
List pgsql-admin
On Thu, Oct 29, 2015 at 12:35 PM, Vladimir Borodin wrote:
> 29 окт. 2015 г., в 14:03, Michael Paquier написал(а):
>> Standby will receive the record but not replay it until the
>> transaction doing REPEATABLE READ transactions that needs those rows
>> commits on the standby. The WAL flush position on the standby
>> continues to move on.
>
> By replication lag on standby I mean exactly replay_location, not
> flush_location.
> Well, the initial problem is that in read commited mode heavy
> SELECT-statement hits max_standby_streaming_delay but in repeatable read
> mode doesn’t. My question is if it is expected behavior? If yes, why is it
> so?

Er, well. If I enforce on master the deletion then VACUUM-cleanup of a
page with a REPEATABLE READ transaction on standby still expecting to
have this page items visible until its commit the startup process puts
itself in waiting state when trying to replay the cleanup record, and
the replay_location does not move on, still the wal receiver gets WAL
in parallel, so it continues to flush things and flush_position
progresses. With a READ COMMITTED transaction running on the standby,
this transaction considers as visible stuff that has been committed,
so WAL replay can move on, and indeed there is a risk to face a
recovery conflict. So this behavior as-is is correct, based on how
isolation levels should behave when a node performs recovery.
--
Michael


pgsql-admin by date:

Previous
From: Vladimir Borodin
Date:
Subject: Re: [HACKERS] Replication slots and isolation levels
Next
From: Kevin Grittner
Date:
Subject: Re: PITR using pg_basebackup ERROR