public inbox for [email protected]  
help / color / mirror / Atom feed
From: Drouvot, Bertrand <[email protected]>
To: shveta malik <[email protected]>
Cc: 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: Wed, 8 Nov 2023 15:39:16 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJpy0uA1-2BH9+V2y-wDJbY0UbV_EhQo-4fbSVy5=Bi5PgzLkA@mail.gmail.com>
References: <CAJpy0uC+2agRtF3H=n-hW5JkoPfaZkjPXJr==y3_PRE04dQvhw@mail.gmail.com>
	<CAJpy0uCMptLCgg-fWWTEcgtRfXAeObaXLUw=i2L4vhPRVXGJMA@mail.gmail.com>
	<[email protected]>
	<CAJpy0uCQQb=UK3h5RWO4_r_MVuLKEGZ34hYrqGmDm+3zVvcJgQ@mail.gmail.com>
	<[email protected]>
	<CAJpy0uC0xa3_uOxeYd29sbnYbLoJjEOsHGotgPqmYzBk3b6=4A@mail.gmail.com>
	<[email protected]>
	<CAJpy0uCwEr6c5MGzvir1sM1fORFUHPqyX6fMz3LE2_TNr_hw0g@mail.gmail.com>
	<[email protected]>
	<CAA4eK1JawxrJ_pWSPPMJb-TG8h0y9Tt7kx9Ei4yBYbRR37a5=w@mail.gmail.com>
	<[email protected]>
	<CAA4eK1LHb9Bb1O0GFft4H8ddtqZeLPCG2hKuSXYvj=du9MjsLw@mail.gmail.com>
	<[email protected]>
	<CAA4eK1KPQuabJneHJU2cvFYHuExiHoN-B=Rkc+zpGhTi_vmh3w@mail.gmail.com>
	<[email protected]>
	<CAJpy0uA1-2BH9+V2y-wDJbY0UbV_EhQo-4fbSVy5=Bi5PgzLkA@mail.gmail.com>

Hi,

On 11/8/23 12:50 PM, shveta malik wrote:
> On Wed, Nov 8, 2023 at 3:19 PM Drouvot, Bertrand
> <[email protected]> wrote:
>>
>> Hi,
>>
>> On 11/8/23 9:57 AM, Amit Kapila wrote:
>>> On Wed, Nov 8, 2023 at 12:32 PM Drouvot, Bertrand
>>> <[email protected]> wrote:
>>>>
>>>> Hi,
>>>>
>>>> On 11/8/23 4:50 AM, Amit Kapila wrote:
>>>>
>>>>> I think if we want to follow
>>>>> this approach then we need to also monitor these slots for any change
>>>>> in the consecutive cycles and if we are able to sync them then
>>>>> accordingly we enable them to use after failover.
>>>>
>>>> What about to add a new field in ReplicationSlotPersistentData
>>>> indicating that we are waiting for "sync" and drop such slots during promotion and
>>>> /or if not in recovery?
>>>>
>>>
>>> This patch is already adding 'synced' flag in
>>> ReplicationSlotPersistentData to distinguish synced slots so that we
>>> can disallow decoding on then in standby and disallow to drop those. I
>>> suggest we change that field to have multiple states where one of the
>>> states would indicate that the initial sync of the slot is done.
>>>
>>
>> Yeah, agree.
>>
> 
> I am working on this implementation.

Thanks!

> This sync-state is even needed
> for cascading standbys to know when to start syncing the slots from
> the first standby. It should start syncing only after the first
> standby has finished initialization of it (i.e. wait for primary is
> over) and not before that.
> 

Yeah, makes sense.

> Unrelated to above, if there is a user slot on standby with the same
> name which the slot-sync worker is trying to create, then shall it
> emit a warning and skip the sync of that slot or shall it throw an
> error?
> 

I'd vote for emit a warning and move on to the next slot if any.

Regards,

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






view thread (55+ 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