pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Anna Akenteva <a.akenteva@postgrespro.ru>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Kartyshov Ivan <i.kartyshov@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed
Date: Tue, 07 Apr 2020 15:07:42 +0300
Message-ID: <a2ea21d1d6c5b96a0695bcd43ee05ed2@postgrespro.ru> (raw)
In-Reply-To: <CAA4eK1+uchxdP8B3Kij-1h8xkc-UrUvicmVx895ONH58xDt4XQ@mail.gmail.com>
References: <80f267591b373db5588d580fdfb432f0@postgrespro.ru>
	<20200306.145445.1788163547829857988.horikyota.ntt@gmail.com>
	<3cc883048264c2e9af022033925ff8db@postgrespro.ru>
	<f4100c14985b1b7983aefd00cb6b491c@postgrespro.ru>
	<a679788da2581506329c4b314ecaf2c7@postgrespro.ru>
	<674ad239b725a11d89c21574e44e376b@postgrespro.ru>
	<69a363498b76cd079ae19c4ee93bced0@postgrespro.ru>
	<06bfb1e542a25c3ebfc4232be4d49555@postgrespro.ru>
	<CAPpHfdu+wp1y=SLaaWiujemr=_bd=Q6=jB8=fVKZbXgVftPBxg@mail.gmail.com>
	<9d112e474c311b6b4c20566314283638@postgrespro.ru>
	<CAPpHfdvhZDyOyhyjtLFoV+HMcUYn0MQE6A+GMO24DFZ+bLXc6A@mail.gmail.com>
	<CAA4eK1+uchxdP8B3Kij-1h8xkc-UrUvicmVx895ONH58xDt4XQ@mail.gmail.com>

On 2020-04-07 13:32, Amit Kapila wrote:
> First, I don't
> think we have a consensus on the syntax being used in the patch
> (various people didn't agree to LSN specific syntax).  They wanted a
> more generic syntax and I see that we tried to implement it and it
> turns out to be a bit complex but that doesn't mean we just give up on
> the idea and take the simplest approach and that too without a broader
> agreement.

Thank you for your comments!

Initially, the syntax used to be "WAITLSN", which confined us with only 
waiting for LSN-s and not anything else. So we switched to "WAIT FOR 
LSN", which would allow us to add variations like "WAIT FOR XID" or 
"WAIT FOR COMMIT TOKEN" in the future if we wanted. A few people seemed 
to imply that this kind of syntax is expandable enough:

On 2018-02-01 14:47, Simon Riggs wrote:
> I agree that WAIT LSN is good syntax because this allows us to wait
> for something else in future.

On 2017-10-31 12:42:56, Ants Aasma wrote:
> For lack of a better proposal I would like something along the lines 
> of:
> WAIT FOR state_id[, state_id] [ OPTIONS (..)]

As for giving up waiting for multiple events: we can only wait for LSN-s 
at the moment, and there seems to be no point in waiting for multiple 
LSN-s at once, because it's equivalent to waiting for the biggest LSN. 
So we opted for simpler grammar for now, only letting the user specify 
one LSN and one TIMEOUT. If in the future we allow waiting for something 
else, like XID-s, we can expand the grammar as needed.

What are your own thoughts on the syntax?

-- 
Anna Akenteva
Postgres Professional:
The Russian Postgres Company
http://www.postgrespro.com





view thread (216+ messages)  latest in thread

Message-ID: <a2ea21d1d6c5b96a0695bcd43ee05ed2@postgrespro.ru>
Permalink:  ../a2ea21d1d6c5b96a0695bcd43ee05ed2@postgrespro.ru/
Also on:    postgresql.org/message-id/a2ea21d1d6c5b96a0695bcd43ee05ed2@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.akenteva@postgrespro.ru, amit.kapila16@gmail.com, a.korotkov@postgrespro.ru, i.kartyshov@postgrespro.ru, pgsql-hackers@lists.postgresql.org
  Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed
  In-Reply-To: <a2ea21d1d6c5b96a0695bcd43ee05ed2@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox