Wake up a subscription's replication worker processes after DDL.
commitc6e1f62e2cee817cad58cccc1dd685e908678241
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 6 Jan 2023 21:08:20 +0000 (6 16:08 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 6 Jan 2023 22:27:58 +0000 (6 17:27 -0500)
tree0b84de1562ac2702f372a86705d8374d77e1eb42
parent4c032dd8046b145a25032643f536aab83deb19e3
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
src/backend/access/transam/xact.c
src/backend/commands/alter.c
src/backend/commands/subscriptioncmds.c
src/backend/replication/logical/worker.c
src/include/replication/logicalworker.h