How to simulate sync/async standbys being closer/farther (network distance) to primary in core postgres? - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject How to simulate sync/async standbys being closer/farther (network distance) to primary in core postgres?
Date
Msg-id CALj2ACXtTSoPwmUx8NfwPzDf=jF9ZzZ36oRctHNps-YbUJ-NWA@mail.gmail.com
Whole thread Raw
Responses Re: How to simulate sync/async standbys being closer/farther (network distance) to primary in core postgres?  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers
Hi,

I'm thinking if there's a way in core postgres to achieve $subject. In
reality, the sync/async standbys can either be closer/farther (which
means sync/async standbys can receive WAL at different times) to
primary, especially in cloud HA environments with primary in one
Availability Zone(AZ)/Region and standbys in different AZs/Regions.
$subject may not be possible on dev systems (say, for testing some HA
features) unless we can inject a delay in WAL senders before sending
WAL.

How about having two developer-only GUCs {async,
sync}_wal_sender_delay? When set, the async and sync WAL senders will
delay sending WAL by {async, sync}_wal_sender_delay
milliseconds/seconds? Although, I can't think of any immediate use, it
will be useful someday IMO, say for features like [1], if it gets in.
With this set of GUCs, one can even add core regression tests for HA
features.

Thoughts?

[1] https://www.postgresql.org/message-id/CALj2ACWCj60g6TzYMbEO07ZhnBGbdCveCrD413udqbRM0O59RA%40mail.gmail.com

Regards,
Bharath Rupireddy.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Separate the result of \watch for each query execution (psql)
Next
From: David Steele
Date:
Subject: Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file