pgsql: Allow notifications to bgworkers without database connections.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема pgsql: Allow notifications to bgworkers without database connections.
Дата
Msg-id E1ZWsET-0005Gu-Q3@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Allow notifications to bgworkers without database connections.

Previously, if one background worker registered another background
worker and set bgw_notify_pid while for the second background worker,
it would not receive notifications from the postmaster unless, at the
time the "parent" was registered, BGWORKER_BACKEND_DATABASE_CONNECTION
was set.

To fix, instead instead of including only those background workers that
requested database connections in the postmater's BackendList, include
them all.  There doesn't seem to be any reason not do this, and indeed
it removes a significant amount of duplicated code.  The other option
is to make PostmasterMarkPIDForWorkerNotify look at BackgroundWorkerList
in addition to BackendList, but that adds more code duplication instead
of getting rid of it.

Patch by me.  Review and testing by Ashutosh Bapat.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8a02b3d732cf3ec13e089768bf9ce9abbdcc8a3e

Modified Files
--------------
src/backend/postmaster/postmaster.c |  136 +++++++----------------------------
1 file changed, 25 insertions(+), 111 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Use in pg_upgrade's procedure
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Allow notifications to bgworkers without database connections.