Re: Allow async standbys wait for sync replication - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Allow async standbys wait for sync replication
Date
Msg-id CALj2ACV=M6OpY4Ugf8hxa2+=EpRvv_Mh3W93Xr2gBCQLweWn0Q@mail.gmail.com
Whole thread Raw
In response to Re: Allow async standbys wait for sync replication  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
On Sat, Mar 5, 2022 at 1:26 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> My point is that there are existing tools for alerting processes when an
> LSN is synchronously replicated and for waking up WAL senders.  What I am
> proposing wouldn't involve spinning in XLogSendPhysical() waiting for
> synchronous replication.  Like SyncRepWaitForLSN(), we'd register our LSN
> in the queue (SyncRepQueueInsert()), but we wouldn't sit in a separate loop
> waiting to be woken.  Instead, SyncRepWakeQueue() would eventually wake up
> the WAL sender and trigger another iteration of WalSndLoop().

While we continue to discuss the other better design at [1], FWIW, I
would like to share a simpler patch that lets wal senders serving
async standbys wait until sync standbys report the flush lsn.
Obviously this is not an elegant way to solve the problem reported in
this thread, as I have this patch ready long back, I wanted to share
it here.

Nathan, of course, this is not something you wanted.

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

Regards,
Bharath Rupireddy.

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Optimize external TOAST storage
Next
From: Andres Freund
Date:
Subject: Re: Proposal: Support custom authentication methods using hooks