mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Replace the pg_listener-based LISTEN/NOTIFY mechanism with an in-memory queue.
In addition, add support for a "payload" string to be passed along with each notify event. This implementation should be significantly more efficient than the old one, and is also more compatible with Hot Standby usage. There is not yet any facility for HS slaves to receive notifications generated on the master, although such a thing is possible in future. Joachim Wieland, reviewed by Jeff Davis; also hacked on by me.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.285 2010/02/13 16:15:46 sriggs Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.286 2010/02/16 22:34:43 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1736,8 +1736,12 @@ CommitTransaction(void)
|
||||
/* close large objects before lower-level cleanup */
|
||||
AtEOXact_LargeObject(true);
|
||||
|
||||
/* NOTIFY commit must come before lower-level cleanup */
|
||||
AtCommit_Notify();
|
||||
/*
|
||||
* Insert notifications sent by NOTIFY commands into the queue. This
|
||||
* should be late in the pre-commit sequence to minimize time spent
|
||||
* holding the notify-insertion lock.
|
||||
*/
|
||||
PreCommit_Notify();
|
||||
|
||||
/* Prevent cancel/die interrupt while cleaning up */
|
||||
HOLD_INTERRUPTS();
|
||||
@ -1825,6 +1829,7 @@ CommitTransaction(void)
|
||||
/* Check we've released all catcache entries */
|
||||
AtEOXact_CatCache(true);
|
||||
|
||||
AtCommit_Notify();
|
||||
AtEOXact_GUC(true, 1);
|
||||
AtEOXact_SPI(true);
|
||||
AtEOXact_on_commit_actions(true);
|
||||
|
Reference in New Issue
Block a user