Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNkpM-00FL1B-2L for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jan 2024 02:29:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rNkpJ-008coU-O0 for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jan 2024 02:29:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNkpH-008co9-Mz for pgsql-hackers@lists.postgresql.org; Thu, 11 Jan 2024 02:29:49 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNkp8-000vnd-6K for pgsql-hackers@lists.postgresql.org; Thu, 11 Jan 2024 02:29:46 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 039EF5C01AD; Wed, 10 Jan 2024 21:29:35 -0500 (EST) Received: from imap49 ([10.202.2.99]) by compute2.internal (MEProxy); Wed, 10 Jan 2024 21:29:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1704940174; x=1705026574; bh=l3dDT/ru49 FeQ3ZBbalVGCbLyd6vPxo4cA7EN+z27g8=; b=qKSwn8Ub50UlMZBsaFkh3aiFqz xVRW/CoXPIKb7vwwgEXGQR/VZSMjMpRGmPaZ/L1l46dkgogh6HXhOVRmptxvZInD LJMEZLlb90Vo38kmtEMup4RxM7wjyHQybXuHgBP9UAIaOOoobJOycFGuUemk/sH3 U18OSlGy9CYIvlzRVyMrwDB054yxJNiCahSBcWaBryDx7Hl6lREfwG/2Z+wxDVCD pCNOKPKFeHSs/LJghbquktsR6uPpH400Q/a3/a0w4qnoNUpxsisCEHA3QMm1mzou 21WhY+1RbLaekNIDHKS4xjzCunBmrukL3vUdegjdiw+kVMpKpNbgz2yvLJ7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1704940174; x=1705026574; bh=l3dDT/ru49FeQ3ZBbalVGCbLyd6v Pxo4cA7EN+z27g8=; b=w/7H8wGamGze6lc6xRRH1EuRgzGQkb9k1m/ZA+gB+dUN V5yv4LsU+OB8MIDaBkShlMwzj0nCuoBN5a4Id034DjX+35W6BpDdACDB0Mfxt3fe xkEe59OnrivUD+KsFPc+qkrSYC/ZgbBxeydg1QXBUnnhzeN7Rzh3CmEHLL4ZOcuP KB9x0clNfhSlNT9dTTml687zTKT4ilHFxXRnuWxDflB23c9+D3e6Tg/5K1F66cXs Goj69RghlSESxFFzzy27csc4hni2I9b+rCU1yiSGKq72p5k/6CMHlwaCRR1E1sZB r6EqJc5XSxgubVJ3yKe6NPFXovLtOEbf55Vc5Vhkfg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeivddggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsegrtderreerredtnecuhfhrohhmpedfgfhu lhgvrhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecugg ftrfgrthhtvghrnhepgfffjedviedvkedviedvteduieekudeivedthffhuddvteegleet ieffkeeghfdvnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegv uhhlvghrthhordgtohhm X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4A7FB15A0092; Wed, 10 Jan 2024 21:29:34 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1374-gc37f3abe3d-fm-20240102.001-gc37f3abe MIME-Version: 1.0 Message-Id: In-Reply-To: References: <5ac50071-f2ed-4ace-a8fd-b892cffd33eb@www.fastmail.com> <4710d895-689a-4ae6-b8e3-344286dbf970@app.fastmail.com> <96e3b739-d63d-4d35-90a3-7869465b7167@eisentraut.org> <2736443c-58e3-42df-8cc4-8c66106e3da5@app.fastmail.com> Date: Wed, 10 Jan 2024 23:29:14 -0300 From: "Euler Taveira" To: "Shlok Kyal" , "Amit Kapila" Cc: "vignesh C" , "Michael Paquier" , "Peter Eisentraut" , pgsql-hackers@lists.postgresql.org, "Andres Freund" , "Ashutosh Bapat" Subject: Re: speed up a logical replica setup Content-Type: multipart/alternative; boundary=e3efbe4fdcd64a3b8b13d48542678c4b List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --e3efbe4fdcd64a3b8b13d48542678c4b Content-Type: text/plain On Wed, Jan 10, 2024, at 1:33 AM, Shlok Kyal wrote: > Here the standby node would be waiting for the 'consistent_lsn' wal > during recovery but this wal will not be present on standby if no > physical replication is setup. Hence the command will be waiting > infinitely for the wal. Hmm. Some validations are missing. > To solve this added a timeout of 60s for the recovery process and also > added a check so that pg_subscriber would give a error when it called > for node which is not in physical replication. > Have attached the patch for the same. It is a top-up patch of the > patch shared by Euler at [1]. If the user has a node that is not a standby and it does not set the GUCs to start the recovery process from a backup, the initial setup is broken. (That's the case you described.) A good UI is to detect this scenario earlier. Unfortunately, there isn't a reliable and cheap way to do it. You need to start the recovery and check if it is having some progress. (I don't have a strong opinion about requiring a standby to use this tool. It would reduce the complexity about checking if the setup has all requirements to run this tool.) -- Euler Taveira EDB https://www.enterprisedb.com/ --e3efbe4fdcd64a3b8b13d48542678c4b Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Wed, Jan 10,= 2024, at 1:33 AM, Shlok Kyal wrote:
Here the standby node would be waiting for the= 'consistent_lsn' wal
during recovery but this wal will no= t be present on standby if no
physical replication is setu= p. Hence the command will be waiting
infinitely for the wa= l.

Hmm. Some validations are m= issing.

To solve this added a timeout of 60s for the recovery proces= s and also
added a check so that pg_subscriber would give = a error when it called
for node which is not in physical r= eplication.
Have attached the patch for the same. It is a = top-up patch of the
patch shared by Euler at [1].

If the user has a node that is no= t a standby and it does not set the GUCs to
start th= e recovery process from a backup, the initial setup is broken. (That's
the case you described.) A good UI is to detect this scenar= io earlier.
Unfortunately, there isn't a reliable and chea= p way to do it. You need to start
the recovery and check i= f it is having some progress. (I don't have a strong
opini= on about requiring a standby to use this tool. It would reduce the
complexity about checking if the setup has all requirements to = run this tool.)


--
Eu= ler Taveira

--e3efbe4fdcd64a3b8b13d48542678c4b--