pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Wake up a subscription's replication worker processes after DDL.
Date: Fri, 06 Jan 2023 22:28:11 +0000
Message-ID: <E1pDvC7-002OGs-HV@gemulon.postgresql.org> (raw)

Wake up a subscription's replication worker processes after DDL.

Waken related worker processes immediately at commit of a transaction
that has performed ALTER SUBSCRIPTION (including the RENAME and
OWNER variants).  This reduces the response time for such operations.
In the real world that might not be worth much, but it shaves several
seconds off the runtime for the subscription test suite.

In the case of PREPARE, we just throw away this notification state;
it doesn't seem worth the work to preserve it.  The workers will
still react after the eventual COMMIT PREPARED, but not as quickly.

Nathan Bossart

Discussion: https://postgr.es/m/20221122004119.GA132961@nathanxps13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c6e1f62e2cee817cad58cccc1dd685e908678241

Modified Files
--------------
src/backend/access/transam/xact.c        |  6 ++++
src/backend/commands/alter.c             |  4 +++
src/backend/commands/subscriptioncmds.c  |  6 ++++
src/backend/replication/logical/worker.c | 52 ++++++++++++++++++++++++++++++++
src/include/replication/logicalworker.h  |  4 +++
5 files changed, 72 insertions(+)



Message-ID: <E1pDvC7-002OGs-HV@gemulon.postgresql.org>
Permalink:  ../E1pDvC7-002OGs-HV@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pDvC7-002OGs-HV@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Wake up a subscription's replication worker processes after DDL.
  In-Reply-To: <E1pDvC7-002OGs-HV@gemulon.postgresql.org>
  References: <E1pDvC7-002OGs-HV@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox