postgresql/src
Amit Kapila 93db6cbda0 Add a new slot sync worker to synchronize logical slots.
By enabling slot synchronization, all the failover logical replication
slots on the primary (assuming configurations are appropriate) are
automatically created on the physical standbys and are synced
periodically. The slot sync worker on the standby server pings the primary
server at regular intervals to get the necessary failover logical slots
information and create/update the slots locally. The slots that no longer
require synchronization are automatically dropped by the worker.

The nap time of the worker is tuned according to the activity on the
primary. The slot sync worker waits for some time before the next
synchronization, with the duration varying based on whether any slots were
updated during the last cycle.

A new parameter sync_replication_slots enables or disables this new
process.

On promotion, the slot sync worker is shut down by the startup process to
drop any temporary slots acquired by the slot sync worker and to prevent
the worker from trying to fetch the failover slots.

A functionality to allow logical walsenders to wait for the physical will
be done in a subsequent commit.

Author: Shveta Malik, Hou Zhijie based on design inputs by Masahiko Sawada and Amit Kapila
Reviewed-by: Masahiko Sawada, Bertrand Drouvot, Peter Smith, Dilip Kumar, Ajin Cherian, Nisha Moond, Kuroda Hayato, Amit Kapila
Discussion: https://postgr.es/m/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com
2024-02-22 15:25:15 +05:30
..
backend Add a new slot sync worker to synchronize logical slots. 2024-02-22 15:25:15 +05:30
bin Add option force_initdb to PostgreSQL::Test::Cluster:init() 2024-02-21 13:28:51 +09:00
common Refactor pipe_read_line to return the full line 2024-02-09 15:03:16 +01:00
fe_utils Centralize logic for restoring errno in signal handlers. 2024-02-14 16:34:18 -06:00
include Add a new slot sync worker to synchronize logical slots. 2024-02-22 15:25:15 +05:30
interfaces ecpg: Fix zero-termination of string generated by intoasc() 2024-02-19 11:38:18 +09:00
makefiles Add backend support for injection points 2024-01-22 10:15:50 +09:00
pl Fix plpgsql to allow new-style SQL CREATE FUNCTION as a SQL command. 2024-01-18 16:11:16 -05:00
port Centralize logic for restoring errno in signal handlers. 2024-02-14 16:34:18 -06:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Add a new slot sync worker to synchronize logical slots. 2024-02-22 15:25:15 +05:30
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Add a slot synchronization function. 2024-02-14 09:45:36 +05:30
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Remove make function vpathsearch 2024-01-29 07:24:59 +01:00
Makefile.shlib Support shared libraries on Android (using make) 2024-01-23 20:37:49 +01:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00