pgsql: Track logrep apply workers' last start times to avoid useless wa

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Track logrep apply workers' last start times to avoid useless wa
Date: 2023-01-22 19:08:57
Message-ID: E1pJfi5-004xGC-57@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5a3a95385bd5a8f1a4fd50545b7efe9338581899

Modified Files
--------------
doc/src/sgml/config.sgml | 4 +
doc/src/sgml/monitoring.sgml | 10 ++
src/backend/commands/subscriptioncmds.c | 10 ++
src/backend/replication/logical/launcher.c | 232 ++++++++++++++++++++++------
src/backend/replication/logical/tablesync.c | 8 +
src/backend/replication/logical/worker.c | 20 +++
src/backend/storage/lmgr/lwlock.c | 4 +
src/include/replication/logicallauncher.h | 2 +
src/include/storage/lwlock.h | 2 +
9 files changed, 243 insertions(+), 49 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2023-01-23 04:35:40 pgsql: Allow parallel aggregate on string_agg and array_agg
Previous Message Tom Lane 2023-01-21 18:10:48 pgsql: Allow REPLICA IDENTITY to be set on an index that's not (yet) va