public inbox for [email protected]  
help / color / mirror / Atom feed
From: Drouvot, Bertrand <[email protected]>
To: Amit Kapila <[email protected]>
To: shveta malik <[email protected]>
Cc: Nisha Moond <[email protected]>
Cc: Zhijie Hou (Fujitsu) <[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: Tue, 5 Dec 2023 15:08:33 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAA4eK1+AumKenLjtVW2y4CpxBr_bo_AVZ67RWdDeJFt+Kgrj0A@mail.gmail.com>
References: <CAJpy0uC+2agRtF3H=n-hW5JkoPfaZkjPXJr==y3_PRE04dQvhw@mail.gmail.com>
	<OS0PR01MB57161C27BCFAF04C2B48B47394BDA@OS0PR01MB5716.jpnprd01.prod.outlook.com>
	<[email protected]>
	<CAJpy0uDKPK537ZW8CAjDVmSjHtBKCzTUzq=it84SrA0PfoWFCg@mail.gmail.com>
	<OS0PR01MB57161938A348977127D56A6694BDA@OS0PR01MB5716.jpnprd01.prod.outlook.com>
	<[email protected]>
	<OS0PR01MB5716DCFD6CC89C2F243B55939483A@OS0PR01MB5716.jpnprd01.prod.outlook.com>
	<[email protected]>
	<CAA4eK1LxGd8GACR36KdtbVaQeKsV9B5-LuBf2o721x6OZ=_wWg@mail.gmail.com>
	<[email protected]>
	<CABdArM5zvpFcOF=_0W-E5bjqjrC2MK+EtFN0UfP43zvaFOc8QA@mail.gmail.com>
	<CAJpy0uCBHRX-GSKCeVza44kFEC=uTMD_6uzuXXnbUX32Vt-g8Q@mail.gmail.com>
	<[email protected]>
	<CAJpy0uDiffV66DofhxZr97Sw2U_-ZkdNCjdRt9tKhnf-CxW57Q@mail.gmail.com>
	<CAA4eK1+AumKenLjtVW2y4CpxBr_bo_AVZ67RWdDeJFt+Kgrj0A@mail.gmail.com>

Hi,

On 12/5/23 12:32 PM, Amit Kapila wrote:
> On Tue, Dec 5, 2023 at 10:38 AM shveta malik <[email protected]> wrote:
>>
>> On Mon, Dec 4, 2023 at 10:07 PM Drouvot, Bertrand
>> <[email protected]> wrote:
>>>>
>>>
>>> Maybe another option could be to have the walreceiver a way to let the slot sync
>>> worker knows that it (the walreceiver) was not able to start due to non existing
>>> replication slot on the primary? (that way we'd avoid the slot sync worker having
>>> to talk to the primary).
>>
>> Few points:
>> 1) I think if we do it, we should do it in generic way i.e. slotsync
>> worker should go to no-op if walreceiver is not able to start due to
>> any reason and not only due to invalid primary_slot_name.
>> 2) Secondly, slotsync worker needs to make sure it has synced the
>> slots so far i.e. worker should not go to no-op immediately on seeing
>> missing WalRcv process if there are pending slots to be synced.
>>
> 
> Won't it be better to just ping and check the validity of
> 'primary_slot_name' at the start of slot-sync and if it is changed
> anytime? I think it would be better to avoid adding dependency on
> walreciever state as that sounds like needless complexity.

I think the overall extra complexity is linked to the fact that we first
want to ensure that the slots are in sync before shutting down the
sync slot worker.

I think than talking to the primary or relying on the walreceiver state
is "just" what would trigger the decision to shutdown the sync slot worker.

Relying on the walreceiver state looks better to me (as it avoids possibly
useless round trips with the primary).

Also the walreceiver could be down for multiple reasons, and I think there
is no point of having a sync slot worker running if the slots are in sync and
there is no walreceiver running (even if primary_slot_name is a valid one).

That said, I'm also ok with the "ping primary" approach if others have another
point of view and find it better.

Regards,

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






view thread (108+ 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], [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