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: 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: Wed, 6 Dec 2023 10:30:08 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJpy0uCAzkua8KAQaLNnYKOJ56x3yJ9kRfDxL8Enp5Li8bzhdQ@mail.gmail.com>
References: <CAJpy0uC+2agRtF3H=n-hW5JkoPfaZkjPXJr==y3_PRE04dQvhw@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>
	<[email protected]>
	<CAA4eK1+EeUUT+gnzoHKWm7GqosA2ehT8QyoKtu1jiyGE=wUErw@mail.gmail.com>
	<CAJpy0uCAzkua8KAQaLNnYKOJ56x3yJ9kRfDxL8Enp5Li8bzhdQ@mail.gmail.com>

Hi,

On 12/6/23 7:18 AM, shveta malik wrote:
> On Wed, Dec 6, 2023 at 10:56 AM Amit Kapila <[email protected]> wrote:
>>
>> I feel that is indirectly relying on the fact that the primary won't
>> advance logical slots unless physical standby has consumed data.
> 
> Yes, that is the basis of this discussion.

Yes.

> But now on rethinking, if
> the user has not set 'standby_slot_names' on primary at first pace,
> then even if walreceiver on standby is down, slots on primary will
> keep on advancing

Oh right, good point.

> and thus we need to sync. 

Yes and I think our current check "XLogRecPtrIsInvalid(WalRcv->latestWalEnd)"
in synchronize_slots() prevents us to do so (as I think WalRcv->latestWalEnd
would be invalid for a non started walreceiver).

> We have no check currently
> that mandates users to set standby_slot_names.
> 

Yeah and OTOH unset standby_slot_names is currently the only
way for users to "force" advance failover slots if they want to (in case
say the standby is down for a long time and they don't want to block logical decoding
on the primary) as we don't provide a way to alter the failover property
(unless connecting with replication which sounds more like a hack).

>> Now,
>> it is possible that slot-sync worker lags behind and still needs to
>> sync more data for slots in which it makes sense for slot-sync worker
>> to be alive.

Right.

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