public inbox for [email protected]  
help / color / mirror / Atom feed
From: Drouvot, Bertrand <[email protected]>
To: shveta malik <[email protected]>
To: Amit Kapila <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: Bharath Rupireddy <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Ashutosh Sharma <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Ajin Cherian <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Subject: Re: Synchronizing slots from primary to standby
Date: Mon, 23 Oct 2023 14:22:13 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJpy0uAb7j2ZNVnm_Mvt+ofCvK1Wh17-d-Jm5ZCq=6V0k327xA@mail.gmail.com>
References: <CAJpy0uC+2agRtF3H=n-hW5JkoPfaZkjPXJr==y3_PRE04dQvhw@mail.gmail.com>
	<CAA4eK1LCH9m_MdAh6WUV4sEmRJFr94FdVy_0MG86ht7VnWh1+Q@mail.gmail.com>
	<CAJpy0uD0t7MA=3L1v+bhANE2BpSRiwaJpJ4fA_RUQWif7RAYNQ@mail.gmail.com>
	<[email protected]>
	<CAA4eK1+5HUcObhZy8_d8mZ7Xt_Ru-TaDDE7FinnRYGVn8Hu78A@mail.gmail.com>
	<CAJpy0uB8zyjej7tRV1m90NqPrZV9UTieYeHragekoVLQPkJePg@mail.gmail.com>
	<[email protected]>
	<CAA4eK1JVey4DRfSAEHfF1kgdfY4hbb1LEhCPGexKwYe2Sm1zVQ@mail.gmail.com>
	<[email protected]>
	<CAJpy0uD5nmxXKDweoLHMKaSEiXs2TnMagi9BtqDp92GFzAfgBw@mail.gmail.com>
	<CAJpy0uD6c3SB+UBG7ULTDydb=xUDfG4EAa6jkwaCVTZFxwrN+w@mail.gmail.com>
	<CAHut+PuP_Hw5WTYCBBKUMRu6M47y1tzB-N469pqxejfh0jTu5Q@mail.gmail.com>
	<CAJpy0uBQB32g0Mcf2yo+cscUF_8L_QEOH-ZwVgeV3eWmn7603A@mail.gmail.com>
	<CAA4eK1J6BqO5=ueFAQO+aYyHLaU-oCHrrVFJqHS-i0Ce9aPY2w@mail.gmail.com>
	<CAJpy0uAb7j2ZNVnm_Mvt+ofCvK1Wh17-d-Jm5ZCq=6V0k327xA@mail.gmail.com>

Hi,

On 10/20/23 5:27 AM, shveta malik wrote:
> On Wed, Oct 18, 2023 at 4:24 PM Amit Kapila <[email protected]> wrote:
> 
> PFA v25 patch set. The changes are:
> 
> 1) 'enable_failover' is changed to 'failover'
> 2) Alter subscription changes to support 'failover'
> 3) Fixes a bug in patch001 wherein any change in standby_slot_names
> was not considered in the flow where logical walsenders wait for
> standby's confirmation. Now during the wait, if standby_slot_names is
> changed, wait is restarted using new standby_slot_names.
> 4) Addresses comments by Bertrand and Amit in [1],[2],[3]
> 
> The changes are mostly in patch001 and a very few in patch002.
> 
> Thank You Ajin for working on alter-subscription changes and adding
> more TAP-tests for 'failover'
> 

Thanks for updating the patch!

Looking at 0001 and doing some experiment:

Creating a logical slot with failover = true and then launching
pg_logical_slot_get_changes() or pg_recvlogical() on it results
to setting failover back to false.

It occurs while creating the decoding context here:

@@ -602,6 +602,9 @@ CreateDecodingContext(XLogRecPtr start_lsn,
         SnapBuildSetTwoPhaseAt(ctx->snapshot_builder, start_lsn);
     }

+   /* set failover in the slot, as requested */
+   slot->data.failover = ctx->failover;
+

I think we can get rid of this change in CreateDecodingContext().

Looking at 0002:

     /* Enter main loop */
     for (;;)
     {
         int         rc;
         long        wait_time = DEFAULT_NAPTIME_PER_CYCLE;

         CHECK_FOR_INTERRUPTS();

         /*
          * If it is Hot standby, then try to launch slot-sync workers else
          * launch apply workers.
          */
         if (RecoveryInProgress())
         {
             /* Launch only if we have succesfully made the connection */
             if (wrconn)
                 LaunchSlotSyncWorkers(&wait_time, wrconn);
         }

We are waiting for DEFAULT_NAPTIME_PER_CYCLE (3 minutes) before checking if there
is new synced slot(s) to be created on the standby. Do we want to keep this behavior
for V1?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com






view thread (69+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Synchronizing slots from primary to standby
  In-Reply-To: <[email protected]>

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

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