Re: [HACKERS] make async slave to wait for lsn to be replayed

Started by Nonameabout 6 years ago2 messageshackers
Jump to latest
#1Noname
a.pervushina@postgrespro.ru

Hello,

I've changed the BEGIN WAIT FOR LSN statement to core functions
pg_waitlsn, pg_waitlsn_infinite and pg_waitlsn_no_wait.
Currently the functions work inside repeatable read transactions, but
waitlsn creates a snapshot if called first in a transaction block, which
can possibly lead the transaction to working incorrectly, so the
function gives a warning.

Usage examples
==========
select pg_waitlsn(‘LSN’, timeout);
select pg_waitlsn_infinite(‘LSN’);
select pg_waitlsn_no_wait(‘LSN’);

Attachments:

t43251_1
pg_waitlsn_v10.patchtext/x-diff; charset=us-ascii; name=pg_waitlsn_v10.patchDownload+455-3
#2Alexander Korotkov
aekorotkov@gmail.com
In reply to: Noname (#1)

Hi!

On Mon, Nov 16, 2020 at 1:09 PM <a.pervushina@postgrespro.ru> wrote:

I've changed the BEGIN WAIT FOR LSN statement to core functions
pg_waitlsn, pg_waitlsn_infinite and pg_waitlsn_no_wait.
Currently the functions work inside repeatable read transactions, but
waitlsn creates a snapshot if called first in a transaction block, which
can possibly lead the transaction to working incorrectly, so the
function gives a warning.

Usage examples
==========
select pg_waitlsn(‘LSN’, timeout);
select pg_waitlsn_infinite(‘LSN’);
select pg_waitlsn_no_wait(‘LSN’);

The name pg_waitlsn_no_wait() looks confusing. I've tried to see how
it's documented, but the patch doesn't contain documentation...

------
Regards,
Alexander Korotkov