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

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: a(dot)korotkov(at)postgrespro(dot)ru
Cc: i(dot)kartyshov(at)postgrespro(dot)ru, a(dot)akenteva(at)postgrespro(dot)ru, amit(dot)kapila16(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed
Date: 2020-04-08 01:09:45
Message-ID: 20200408.100945.375702947246835193.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 8 Apr 2020 02:52:55 +0300, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru> wrote in
> On Wed, Apr 8, 2020 at 2:14 AM Kartyshov Ivan
> <i(dot)kartyshov(at)postgrespro(dot)ru> wrote:
> > On 2020-04-08 00:27, Tom Lane wrote:
> > > Alexander Korotkov <akorotkov(at)postgresql(dot)org> writes:
> > » WAIT FOR LSN lsn [ TIMEOUT timeout ]
> > >
> > > This seems like a really carelessly chosen syntax —- *three* new
> > > keywords, when you probably didn't need any. Are you not aware that
> > > there is distributed overhead in the grammar for every keyword?
> > > Plus, each new keyword carries the risk of breaking existing
> > > applications, since it no longer works as an alias-not-preceded-by-AS.
> > >
> >
> > To avoid creating new keywords, we could change syntax in the following
> > way:
> > WAIT FOR => DEPENDS ON
>
> Looks OK for me.
>
> > LSN => EVENT
>
> I think it's too generic. Not every event is lsn. TBH, lsn is not
> event at all :)
>
> I wonder is we can still use word lsn, but don't use keyword for that.
> Can we take arbitrary non-quoted literal there and check it later?
>
> > TIMEOUT => WITH INTERVAL
>
> I'm not yet sure about this. Probably there are better options.

How about something like the follows.

BEGIN AFTER ColId Sconst
BEGIN FOLOWING ColId Sconst

UNTIL <absolute time>;
LIMIT BY <interval>;
WITHIN Iconst;

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-04-08 01:13:51 Re: pgsql: Allow users to limit storage reserved by replication slots
Previous Message David Rowley 2020-04-08 01:04:08 Re: Use compiler intrinsics for bit ops in hash