Re: Switching XLog source from archive to streaming when primary available
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: bharath.rupireddyforpostgres@gmail.com
Cc: nathandbossart@gmail.com, cary.huang@highgo.ca,
pgsql-hackers@lists.postgresql.org, satyanarlapuram@gmail.com
Date: 2022-09-09T05:16:17Z
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
Being late for the party.
It seems to me that the function is getting too long. I think we
might want to move the core part of the patch into another function.
I think it might be better if intentionalSourceSwitch doesn't need
lastSourceFailed set. It would look like this:
> if (lastSourceFailed || switchSource)
> {
> if (nonblocking && lastSourceFailed)
> return XLREAD_WOULDBLOCK;
+ if (first_time)
+ last_switch_time = curr_time;
..
+ if (!first_time &&
+ TimestampDifferenceExceeds(last_switch_time, curr_time,
..
+ /* We're not here for the first time any more */
+ if (first_time)
+ first_time = false;
I don't think the flag first_time is needed.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center