No AVworkers when PM_RECOVERY_CONSISTENT
When pmState == PM_RECOVERY_CONSISTENT we run
SignalAutovacWorkers(SIGTERM);
at normal shutdown
This currently does nothing, but since there aren't ever going to be any
AVworkers at this time we should be explicitly skipping this. That
should avoid misunderstanding the code and avoid any future side
effects.
Low priority, minor.
Removed while updating earlier work on HS.
--
Simon Riggs www.2ndQuadrant.com
Attachments:
shutdown_av_only_in_PM_RUN.v1.patchtext/x-patch; charset=UTF-8; name=shutdown_av_only_in_PM_RUN.v1.patchDownload
Index: src/backend/postmaster/postmaster.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/src/backend/postmaster/postmaster.c,v
retrieving revision 1.594
diff -c -r1.594 postmaster.c
*** src/backend/postmaster/postmaster.c 31 Aug 2009 19:41:00 -0000 1.594
--- src/backend/postmaster/postmaster.c 3 Sep 2009 13:31:28 -0000
***************
*** 2108,2114 ****
pmState == PM_RECOVERY_CONSISTENT)
{
/* autovacuum workers are told to shut down immediately */
! SignalAutovacWorkers(SIGTERM);
/* and the autovac launcher too */
if (AutoVacPID != 0)
signal_child(AutoVacPID, SIGTERM);
--- 2107,2114 ----
pmState == PM_RECOVERY_CONSISTENT)
{
/* autovacuum workers are told to shut down immediately */
! if (pmState == PM_RUN)
! SignalAutovacWorkers(SIGTERM);
/* and the autovac launcher too */
if (AutoVacPID != 0)
signal_child(AutoVacPID, SIGTERM);
Simon Riggs <simon@2ndQuadrant.com> writes:
When pmState == PM_RECOVERY_CONSISTENT we run
SignalAutovacWorkers(SIGTERM);
at normal shutdown
This currently does nothing, but since there aren't ever going to be any
AVworkers at this time we should be explicitly skipping this. That
should avoid misunderstanding the code and avoid any future side
effects.
The code is trying to signal every child that exists. By that logic we
should have a lot more conditionals to try to avoid signaling process
that "shouldn't" exist in the current PM state --- eg, the following
line where the AV launcher is signaled. I don't think it's going to
be an improvement in either readability or robustness.
regards, tom lane