pgsql: Replace the pg_listener-based LISTEN/NOTIFY mechanism with an

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Replace the pg_listener-based LISTEN/NOTIFY mechanism with an
Date: 2010-02-16 22:34:57
Message-ID: 20100216223457.B6D0C7541C5@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/doc/src/sgml:
catalogs.sgml (r2.221 -> r2.222)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/catalogs.sgml?r1=2.221&r2=2.222)
func.sgml (r1.503 -> r1.504)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/func.sgml?r1=1.503&r2=1.504)
libpq.sgml (r1.298 -> r1.299)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/libpq.sgml?r1=1.298&r2=1.299)
protocol.sgml (r1.80 -> r1.81)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/protocol.sgml?r1=1.80&r2=1.81)
storage.sgml (r1.31 -> r1.32)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/storage.sgml?r1=1.31&r2=1.32)
pgsql/doc/src/sgml/ref:
listen.sgml (r1.23 -> r1.24)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/listen.sgml?r1=1.23&r2=1.24)
notify.sgml (r1.31 -> r1.32)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/notify.sgml?r1=1.31&r2=1.32)
unlisten.sgml (r1.30 -> r1.31)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/unlisten.sgml?r1=1.30&r2=1.31)
pgsql/src/backend/access/transam:
slru.c (r1.48 -> r1.49)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/slru.c?r1=1.48&r2=1.49)
twophase_rmgr.c (r1.12 -> r1.13)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/twophase_rmgr.c?r1=1.12&r2=1.13)
xact.c (r1.285 -> r1.286)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xact.c?r1=1.285&r2=1.286)
pgsql/src/backend/catalog:
Makefile (r1.76 -> r1.77)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/Makefile?r1=1.76&r2=1.77)
pgsql/src/backend/commands:
async.c (r1.150 -> r1.151)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/async.c?r1=1.150&r2=1.151)
pgsql/src/backend/nodes:
copyfuncs.c (r1.461 -> r1.462)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.461&r2=1.462)
equalfuncs.c (r1.382 -> r1.383)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c?r1=1.382&r2=1.383)
outfuncs.c (r1.382 -> r1.383)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.382&r2=1.383)
readfuncs.c (r1.231 -> r1.232)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/readfuncs.c?r1=1.231&r2=1.232)
pgsql/src/backend/parser:
gram.y (r2.708 -> r2.709)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y?r1=2.708&r2=2.709)
pgsql/src/backend/storage/ipc:
ipci.c (r1.103 -> r1.104)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/ipc/ipci.c?r1=1.103&r2=1.104)
pgsql/src/backend/storage/lmgr:
lwlock.c (r1.55 -> r1.56)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lwlock.c?r1=1.55&r2=1.56)
pgsql/src/backend/tcop:
postgres.c (r1.589 -> r1.590)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c?r1=1.589&r2=1.590)
utility.c (r1.332 -> r1.333)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/utility.c?r1=1.332&r2=1.333)
pgsql/src/backend/utils/adt:
ruleutils.c (r1.322 -> r1.323)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ruleutils.c?r1=1.322&r2=1.323)
pgsql/src/bin/initdb:
initdb.c (r1.184 -> r1.185)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/initdb/initdb.c?r1=1.184&r2=1.185)
pgsql/src/bin/psql:
common.c (r1.143 -> r1.144)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/common.c?r1=1.143&r2=1.144)
tab-complete.c (r1.193 -> r1.194)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/tab-complete.c?r1=1.193&r2=1.194)
pgsql/src/include/access:
slru.h (r1.25 -> r1.26)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/slru.h?r1=1.25&r2=1.26)
twophase_rmgr.h (r1.11 -> r1.12)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/twophase_rmgr.h?r1=1.11&r2=1.12)
pgsql/src/include/catalog:
catversion.h (r1.584 -> r1.585)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h?r1=1.584&r2=1.585)
pg_proc.h (r1.568 -> r1.569)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_proc.h?r1=1.568&r2=1.569)
pgsql/src/include/commands:
async.h (r1.39 -> r1.40)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/async.h?r1=1.39&r2=1.40)
pgsql/src/include/nodes:
parsenodes.h (r1.429 -> r1.430)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/parsenodes.h?r1=1.429&r2=1.430)
pgsql/src/include/storage:
lwlock.h (r1.44 -> r1.45)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/lwlock.h?r1=1.44&r2=1.45)
pgsql/src/test/regress/expected:
guc.out (r1.9 -> r1.10)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/guc.out?r1=1.9&r2=1.10)
sanity_check.out (r1.44 -> r1.45)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/sanity_check.out?r1=1.44&r2=1.45)
pgsql/src/test/regress/sql:
guc.sql (r1.8 -> r1.9)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/guc.sql?r1=1.8&r2=1.9)

Removed Files:
-------------
pgsql/src/include/catalog:
pg_listener.h
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_listener.h)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-02-17 00:52:09 pgsql: Make NOTIFY_PAYLOAD_MAX_LENGTH depend explicitly on BLCKSZ and
Previous Message Andrew Dunstan 2010-02-16 22:19:59 pgsql: Add query text to auto_explain output.