public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bharath Rupireddy <[email protected]>
To: Kyotaro Horiguchi <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Subject: Re: Switching XLog source from archive to streaming when primary available
Date: Fri, 16 Sep 2022 09:15:58 +0530
Message-ID: <CALj2ACUpprK2nMBAr4VMoOGL4PrSj7V6upJQFhPRirUM4a0fQg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CALj2ACV0ZkXggzMrfx6pi_MGTR-rGOY3AOUwvUP1pg=iE6+LwA@mail.gmail.com>
	<CALj2ACX8cgYVSZfWkW9wKmLExxYu13mR-H389vOaniKVG+Kf4g@mail.gmail.com>
	<CALj2ACUBuc574n8g-QUQGha=J8C-cWJ4KwW1dOGe5HG0NH4s2w@mail.gmail.com>
	<[email protected]>

On Thu, Sep 15, 2022 at 1:52 PM Kyotaro Horiguchi
<[email protected]> wrote:
>
> At Thu, 15 Sep 2022 10:28:12 +0530, Bharath Rupireddy <[email protected]> wrote in
> > I'm attaching the v6 patch that's rebased on to the latest HEAD.
> > Please consider this for review.
>
> Thaks for the new version!
>
> +#define StreamingReplRetryEnabled() \
> +       (streaming_replication_retry_interval > 0 && \
> +        StandbyMode && \
> +        currentSource == XLOG_FROM_ARCHIVE)
>
> It seems to me a bit too complex..

I don't think so, it just tells whether a standby is allowed to switch
source to stream from archive.

> +                       /* Save the timestamp at which we're switching to archive. */
> +                       if (StreamingReplRetryEnabled())
> +                               switched_to_archive_at = GetCurrentTimestamp();
>
> Anyway we are going to open a file just after this so
> GetCurrentTimestamp() cannot cause a perceptible degradation.
> Coulnd't we do that unconditionally, to get rid of the macro?

Do we really need to do it unconditionally? I don't think so. And, we
can't get rid of the macro, as we need to check for the current
source, GUC and standby mode. When this feature is disabled, it
mustn't execute any extra code IMO.

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





view thread (32+ 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]
  Subject: Re: Switching XLog source from archive to streaming when primary available
  In-Reply-To: <CALj2ACUpprK2nMBAr4VMoOGL4PrSj7V6upJQFhPRirUM4a0fQg@mail.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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox