Track logrep apply workers' last start times to avoid useless waits.
authorTom Lane
Sun, 22 Jan 2023 19:08:46 +0000 (14:08 -0500)
committerTom Lane
Sun, 22 Jan 2023 19:08:46 +0000 (14:08 -0500)
commit5a3a95385bd5a8f1a4fd50545b7efe9338581899
tree9c90b781d4c5ccfdfe361e179c364b34c91137ac
parentc9f7f926484d69e2806e35343af7e472fadfede7
Track logrep apply workers' last start times to avoid useless waits.

Enforce wal_retrieve_retry_interval on a per-subscription basis,
rather than globally, and arrange to skip that delay in case of
an intentional worker exit.  This probably makes little difference
in the field, where apply workers wouldn't be restarted often;
but it has a significant impact on the runtime of our logical
replication regression tests (even though those tests use
artificially-small wal_retrieve_retry_interval settings already).

Nathan Bossart, with mostly-cosmetic editorialization by me

Discussion: https://postgr.es/m/20221122004119.GA132961@nathanxps13
doc/src/sgml/config.sgml
doc/src/sgml/monitoring.sgml
src/backend/commands/subscriptioncmds.c
src/backend/replication/logical/launcher.c
src/backend/replication/logical/tablesync.c
src/backend/replication/logical/worker.c
src/backend/storage/lmgr/lwlock.c
src/include/replication/logicallauncher.h
src/include/storage/lwlock.h