pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Euler Taveira <euler@eulerto.com>
Cc: Shlok Kyal <shlok.kyal.oss@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Fabrízio de Royes Mello <fabriziomello@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>
Subject: RE: speed up a logical replica setup
Date: Wed, 3 Jul 2024 03:51:48 +0000
Message-ID: <OSBPR01MB25529FD2B4147D2DD99E032CF5DD2@OSBPR01MB2552.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAA4eK1+p+7Ag6nqdFRdqowK1EmJ6bG-MtZQ_54dnFBi=_OO5RQ@mail.gmail.com>
References: <9a9c7e65-c47b-4400-a63e-ac6169c0860e@app.fastmail.com>
	<65b841a8-0c2f-4953-b9cd-240fce84b90b@eisentraut.org>
	<TYCPR01MB12077907C052EC329C45AE198F5362@TYCPR01MB12077.jpnprd01.prod.outlook.com>
	<c8e92bcb-69c3-477e-93d4-6f39e030cab0@app.fastmail.com>
	<47524383-6fd1-4b13-8c4e-fb918b1d35ba@enterprisedb.com>
	<bbbeed26-41f9-468c-ac24-ad99f429ccd7@app.fastmail.com>
	<CAA4eK1KPoLUUGzjw9eEQd56LUAf2QQj8BqMcsoSe6vycB5CYUQ@mail.gmail.com>
	<2e86cf53-c806-49d2-9a10-1a1257776d1f@app.fastmail.com>
	<CAA4eK1JJq_ER6Kq_H=jKHR75QPRd8y9_D=RtYw=aPYKMfqLi9A@mail.gmail.com>
	<CAA4eK1KdCb+5sjYu6qCMXXdCX1y_ihr8kFzMozq0=P=auYxgog@mail.gmail.com>
	<CANhcyEV6q1Vhd37i1axUeScLi0UAGVxta1LDa0BV0Eh--TcPMg@mail.gmail.com>
	<CAA4eK1JaQcAZ=n513-4VDW4ujE9T9f007fczNCpVDbg1smhT4g@mail.gmail.com>
	<5da4b286-e570-4341-8262-92d763f6b1a4@app.fastmail.com>
	<776c5cac-5ef5-4001-b1bc-5b698bc0c62a@app.fastmail.com>
	<3c024250-3f13-4f4d-b8e9-55f176db4abf@eisentraut.org>
	<0dffca12-bf17-4a7a-334d-225569de5e6e@gmail.com>
	<2377319.1719766794@sss.pgh.pa.us>
	<OSBPR01MB25521B15BF950D2523BBE143F5D32@OSBPR01MB2552.jpnprd01.prod.outlook.com>
	<CAA4eK1+p+7Ag6nqdFRdqowK1EmJ6bG-MtZQ_54dnFBi=_OO5RQ@mail.gmail.com>

Dear Amit,

> IIUC, the problem is that the consistent_lsn value returned by
> setup_publisher() is the "end +1" location of the required LSN whereas
> the recovery_target_lsn used in wait_for_end_recovery() expects the
> LSN value to be "start" location of required LSN.

Yeah, right. It is same as my understanding.
	
> This sounds like an ugly hack to me and don't know if we can use it.

I also think it is hacky, but I could not find better solutions.

> The ideal way to fix this is to get the start_lsn from the
> create_logical_slot functionality or have some parameter like
> recover_target_end_lsn but I don't know if this is a good time to
> extend such a functionality.

I felt that such approach might be used for HEAD, but not suitable for PG17.
Alternative approach I came up with was to insert a tuple while waiting the
promotion. It can generate a WAL record so that standby can finish after the
application. But I'm not sure how do we do and it seems to lead an additional
timing issue. Also, this does not improve the behavior of the command - normal
user may have to wait some time by the command.

Do you have any other idea?

Best Regards,
Hayato Kuroda
FUJITSU LIMITED
https://www.fujitsu.com/ 



view thread (320+ messages)  latest in thread

Message-ID: <OSBPR01MB25529FD2B4147D2DD99E032CF5DD2@OSBPR01MB2552.jpnprd01.prod.outlook.com>
Permalink:  ../OSBPR01MB25529FD2B4147D2DD99E032CF5DD2@OSBPR01MB2552.jpnprd01.prod.outlook.com/
Also on:    postgresql.org/message-id/OSBPR01MB25529FD2B4147D2DD99E032CF5DD2@OSBPR01MB2552.jpnprd01.prod.outlook.com

 · 

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: kuroda.hayato@fujitsu.com, amit.kapila16@gmail.com, tgl@sss.pgh.pa.us, exclusion@gmail.com, peter@eisentraut.org, euler@eulerto.com, shlok.kyal.oss@gmail.com, tomas.vondra@enterprisedb.com, bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org, michael@paquier.xyz, andres@anarazel.de, ashutosh.bapat.oss@gmail.com, fabriziomello@gmail.com, vignesh21@gmail.com
  Subject: RE: speed up a logical replica setup
  In-Reply-To: <OSBPR01MB25529FD2B4147D2DD99E032CF5DD2@OSBPR01MB2552.jpnprd01.prod.outlook.com>

* 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