]> granicus.if.org Git - postgresql/commit
Notify bgworker registrant after freeing worker slot.
authorRobert Haas <rhaas@postgresql.org>
Fri, 3 Mar 2017 03:44:49 +0000 (09:14 +0530)
committerRobert Haas <rhaas@postgresql.org>
Fri, 3 Mar 2017 03:55:30 +0000 (09:25 +0530)
commitaea5d298362e881b13d95a48c5ae116879237389
treedcddedf44de68363c02d593d26f2f52c87d6fab0
parent5a73e17317e91912b2755f7960d5bf31d374cf31
Notify bgworker registrant after freeing worker slot.

Tom Lane observed buildfarm failures caused by the select_parallel
regression test trying to launch new parallel queries before the
worker slots used by the previous ones were freed.  Try to fix this by
having the postmaster free the worker slots before it sends the
SIGUSR1 notifications to the registering process.  This doesn't
completely eliminate the possibility that the user backend might
(correctly) observe the worker as dead before the slot is free, but I
believe it should make the window significantly narrower.

Patch by me, per complaint from Tom Lane.  Reviewed by Amit Kapila.

Discussion: http://postgr.es/m/30673.1487310734@sss.pgh.pa.us
src/backend/postmaster/bgworker.c
src/backend/postmaster/postmaster.c
src/include/postmaster/bgworker_internals.h