diff options
author | Alexander Korotkov | 2024-04-02 19:48:03 +0000 |
---|---|---|
committer | Alexander Korotkov | 2024-04-02 19:48:03 +0000 |
commit | 06c418e163e913966e17cb2d3fb1c5f8a8d58308 (patch) | |
tree | 10945dd3132f4b262d416ce55c88b7955dc67537 /src/backend/commands/meson.build | |
parent | 6faca9ae2878c8f642a2e5748d2dbb2b91341bec (diff) |
Implement pg_wal_replay_wait() stored procedure
pg_wal_replay_wait() is to be used on standby and specifies waiting for
the specific WAL location to be replayed before starting the transaction.
This option is useful when the user makes some data changes on primary and
needs a guarantee to see these changes on standby.
The queue of waiters is stored in the shared memory array sorted by LSN.
During replay of WAL waiters whose LSNs are already replayed are deleted from
the shared memory array and woken up by setting of their latches.
pg_wal_replay_wait() needs to wait without any snapshot held. Otherwise,
the snapshot could prevent the replay of WAL records implying a kind of
self-deadlock. This is why it is only possible to implement
pg_wal_replay_wait() as a procedure working in a non-atomic context,
not a function.
Catversion is bumped.
Discussion: https://postgr.es/m/eb12f9b03851bb2583adab5df9579b4b%40postgrespro.ru
Author: Kartyshov Ivan, Alexander Korotkov
Reviewed-by: Michael Paquier, Peter Eisentraut, Dilip Kumar, Amit Kapila
Reviewed-by: Alexander Lakhin, Bharath Rupireddy, Euler Taveira
Diffstat (limited to 'src/backend/commands/meson.build')
-rw-r--r-- | src/backend/commands/meson.build | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/commands/meson.build b/src/backend/commands/meson.build index 6dd00a4abde..7549be5dc3b 100644 --- a/src/backend/commands/meson.build +++ b/src/backend/commands/meson.build @@ -50,4 +50,5 @@ backend_sources += files( 'vacuumparallel.c', 'variable.c', 'view.c', + 'waitlsn.c', ) |