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

From: Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>
To: Anna Akenteva <a(dot)akenteva(at)postgrespro(dot)ru>, Ivan Kartyshov <i(dot)kartyshov(at)postgrespro(dot)ru>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Adam Brusselback <adambrusselback(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed
Date: 2020-04-03 14:29:45
Message-ID: 69a363498b76cd079ae19c4ee93bced0@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-04-01 02:26, Anna Akenteva wrote:
> On 2020-03-27 04:15, Kartyshov Ivan wrote:
>> Anna, feel free to work on this patch.
>
> Ivan and I worked on this patch a bit more. We fixed the bugs that we
> could find and cleaned up the code. For now, we've kept both options:
> WAIT as a standalone statement and WAIT as a part of BEGIN. The new
> patch is attached.
>
> The syntax looks a bit different now:
>
> - WAIT FOR [ANY | ALL] event [, ...]
> - BEGIN [ WORK | TRANSACTION ] [ transaction_mode [, ...] ] [ WAIT FOR
> [ANY | ALL] event [, ...]]
> where event is one of:
> LSN value
> TIMEOUT number_of_milliseconds
> timestamp
>
> Now, one event cannot contain both an LSN and a TIMEOUT.
>

In my understanding the whole idea of having TIMEOUT was to do something
like 'Do wait for this LSN to be replicated, but no longer than TIMEOUT
milliseconds'. What is the point of having plain TIMEOUT? It seems to be
equivalent to pg_sleep, doesn't it?

Regards
--
Alexey Kondratov

Postgres Professional https://www.postgrespro.com
Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-04-03 14:34:37 Re: zombie connections
Previous Message Amit Langote 2020-04-03 14:25:02 Re: adding partitioned tables to publications