From: | Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> |
---|---|
To: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: protocol-level wait-for-LSN |
Date: | 2024-10-29 10:45:41 |
Message-ID: | CAEze2Whz+z95O=JCHOxiRMNWN2vYBqH867xkyZ9EcQUZVEcxSQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, 28 Oct 2024, 16:51 Peter Eisentraut, <peter(at)eisentraut(dot)org> wrote:
>
> This is something I hacked together on the way back from pgconf.eu.
> It's highly experimental.
>
> The idea is to do the equivalent of pg_wal_replay_wait() on the protocol
> level, so that it is ideally fully transparent to the application code.
> The application just issues queries, and they might be serviced by a
> primary or a standby, but there is always a correct ordering of reads
> after writes.
+1
> Thoughts?
I think it would be quite beneficial to include the cluster ID in
these messages, so that e.g. logical replication can be guaranteed to
be cought up to the recent commit when querying a sharded cluster.
So instead of just LSN, PostgreSQL would return the [cluster_id, LSN]
pair (maybe: pairs, given that you may want to have forward-only view
of a logical primary across 2 different logical subscribers; postgres
could supply a pair [cluster_id, LSN] for every logical subscriber
slot), while the "wait for LSN" protocol feature would accept a list
of these, waiting for the logical subscriptions and/or physical
replication that source their changes from those cluster_ids to catch
up to those LSNs.
Kind regards,
Matthias van de Meent
Neon (https://neon.tech)
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Gustafsson | 2024-10-29 10:52:23 | Re: [PoC] Federated Authn/z with OAUTHBEARER |
Previous Message | Michail Nikolaev | 2024-10-29 10:40:54 | Re: Conflict detection for update_deleted in logical replication |