Re: Switching XLog source from archive to streaming when primary available
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: nathandbossart@gmail.com, cary.huang@highgo.ca, pgsql-hackers@lists.postgresql.org, satyanarlapuram@gmail.com
Date: 2022-09-16T03:45:58Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add basic TAP tests for the low-level backup method, take two
- 071e3ad59d6f 17.0 cited
-
Add a failover option to subscriptions.
- 776621a5e479 17.0 cited
-
Make all Perl warnings fatal
- c5385929593d 17.0 cited
-
Add PostgreSQL::Test::Cluster::advance_wal
- c161ab74f76a 17.0 cited
-
Rename wal_keep_segments to wal_keep_size.
- c3fe108c025e 14.0 cited
On Thu, Sep 15, 2022 at 1:52 PM Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote: > > At Thu, 15 Sep 2022 10:28:12 +0530, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> 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