pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Drouvot, Bertrand <bertranddrouvot.pg@gmail.com>
To: Noah Misch <noah@leadboat.com>
To: Andres Freund <andres@anarazel.de>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Ibrar Ahmed <ibrar.ahmad@gmail.com>
Cc: Amit Khandekar <amitdkhan.pg@gmail.com>
Cc: fabriziomello@gmail.com, tushar <tushar.ahuja@enterprisedb.com>
Cc: Rahila Syed <rahila.syed@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Minimal logical decoding on standbys
Date: Tue, 11 Apr 2023 11:04:50 +0200
Message-ID: <002cc876-0838-2821-e9d8-bb3791386814@gmail.com> (raw)
In-Reply-To: <e217cdaf-53a1-6d41-59e2-4f4a8bbe9f23@gmail.com>
References: <1903ca9b-1dc9-20a6-404a-d4c460c7bdcc@gmail.com>
	<CAA4eK1KFrxgQJt7kc-_o5ruLvafw_FR=NUizA8A7Bp1TDOEj8g@mail.gmail.com>
	<2b002763-f39f-0814-e98e-c48989ddc3c3@gmail.com>
	<3c9d4998-a338-081f-a5f6-d038ead75384@gmail.com>
	<20230407055618.33gjg5vd5hq3kje4@awork3.anarazel.de>
	<71c3d91a-6b3b-5c0a-ffb9-630f17fe693e@gmail.com>
	<20230407075009.igg7be27ha2htkbt@awork3.anarazel.de>
	<1e923731-ed09-3621-c8b9-61f938b4c355@gmail.com>
	<20230407154757.ywqnldz4nsycap3g@awork3.anarazel.de>
	<20230407181226.6oyt4jcazy6eh7rx@awork3.anarazel.de>
	<20230411053657.GA1177147@rfd.leadboat.com>
	<7eb26a22-a6b2-f938-6d3c-6adcf4785004@gmail.com>
	<e217cdaf-53a1-6d41-59e2-4f4a8bbe9f23@gmail.com>

Hi,

On 4/11/23 10:55 AM, Drouvot, Bertrand wrote:
> Hi,
> 
> I think we might want to add:
> 
> $node_primary->wait_for_replay_catchup($node_standby);
> 
> before calling the slot creation.
> 
> It's done in the attached, would it be possible to give it a try please?

Actually, let's also wait for the cascading standby to catchup too, like done in the attached.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
diff --git a/src/test/recovery/t/035_standby_logical_decoding.pl b/src/test/recovery/t/035_standby_logical_decoding.pl
index ba98a18bd2..94a8384c31 100644
--- a/src/test/recovery/t/035_standby_logical_decoding.pl
+++ b/src/test/recovery/t/035_standby_logical_decoding.pl
@@ -653,9 +653,15 @@ $node_standby->reload;
 $node_primary->psql('postgres', q[CREATE DATABASE testdb]);
 $node_primary->safe_psql('testdb', qq[CREATE TABLE decoding_test(x integer, y text);]);
 
+# Wait for the standby to catchup before creating the slots
+$node_primary->wait_for_replay_catchup($node_standby);
+
 # create the logical slots
 create_logical_slots($node_standby, 'promotion_');
 
+# Wait for the cascading standby to catchup before creating the slots
+$node_standby->wait_for_replay_catchup($node_cascading_standby, $node_primary);
+
 # create the logical slots on the cascading standby too
 create_logical_slots($node_cascading_standby, 'promotion_');
 


Attachments:

  [text/plain] hoverfly2.patch (943B, ../002cc876-0838-2821-e9d8-bb3791386814@gmail.com/2-hoverfly2.patch)
  download | inline diff:
diff --git a/src/test/recovery/t/035_standby_logical_decoding.pl b/src/test/recovery/t/035_standby_logical_decoding.pl
index ba98a18bd2..94a8384c31 100644
--- a/src/test/recovery/t/035_standby_logical_decoding.pl
+++ b/src/test/recovery/t/035_standby_logical_decoding.pl
@@ -653,9 +653,15 @@ $node_standby->reload;
 $node_primary->psql('postgres', q[CREATE DATABASE testdb]);
 $node_primary->safe_psql('testdb', qq[CREATE TABLE decoding_test(x integer, y text);]);
 
+# Wait for the standby to catchup before creating the slots
+$node_primary->wait_for_replay_catchup($node_standby);
+
 # create the logical slots
 create_logical_slots($node_standby, 'promotion_');
 
+# Wait for the cascading standby to catchup before creating the slots
+$node_standby->wait_for_replay_catchup($node_cascading_standby, $node_primary);
+
 # create the logical slots on the cascading standby too
 create_logical_slots($node_cascading_standby, 'promotion_');
 


view thread (361+ messages)  latest in thread

Message-ID: <002cc876-0838-2821-e9d8-bb3791386814@gmail.com>
Permalink:  ../002cc876-0838-2821-e9d8-bb3791386814@gmail.com/
Also on:    postgresql.org/message-id/002cc876-0838-2821-e9d8-bb3791386814@gmail.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: bertranddrouvot.pg@gmail.com, noah@leadboat.com, andres@anarazel.de, amit.kapila16@gmail.com, alvherre@alvh.no-ip.org, pgsql@j-davis.com, robertmhaas@gmail.com, thomas.munro@gmail.com, ibrar.ahmad@gmail.com, amitdkhan.pg@gmail.com, tushar.ahuja@enterprisedb.com, rahila.syed@2ndquadrant.com
  Subject: Re: Minimal logical decoding on standbys
  In-Reply-To: <002cc876-0838-2821-e9d8-bb3791386814@gmail.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