pg.conf re-reading in signal handler or at next return to main loop?
Hi,
src/backend/utils/misc/README says
"
If SIGHUP is received, the GUC code rereads the postgresql.conf
configuration file (this does not happen in the signal handler, but at
next return to main loop; note that it can be executed while within a
transaction).
"
SIGHUP_handler() calls ProcessConfigFile() which calls
ParseConfigFile() which reads postgresql.conf.
For me that means that postgresql.conf in read in the signal handler,
which contradicts the claim in the README. Where's my error?
Markus Bertheau
"Markus Bertheau" <mbertheau.pg@googlemail.com> writes:
SIGHUP_handler() calls ProcessConfigFile() which calls
ParseConfigFile() which reads postgresql.conf.
For me that means that postgresql.conf in read in the signal handler,
which contradicts the claim in the README. Where's my error?
The comment is referring to the control flow in a backend; you're
looking at the postmaster's sighup handler, which is different.
regards, tom lane
2006/3/6, Tom Lane <tgl@sss.pgh.pa.us>:
The comment is referring to the control flow in a backend; you're
looking at the postmaster's sighup handler, which is different.
Then the following comment patch is appropriate, afaics.
Markus Bertheau
Attachments:
guc-comment.patchtext/x-patch; charset=us-ascii; name=guc-comment.patchDownload
Index: src/include/utils/guc.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/utils/guc.h,v
retrieving revision 1.64
diff -c -r1.64 guc.h
*** src/include/utils/guc.h 5 Mar 2006 15:59:07 -0000 1.64
--- src/include/utils/guc.h 6 Mar 2006 17:58:59 -0000
***************
*** 31,40 ****
*
* SIGHUP options can only be set at postmaster startup or by changing
* the configuration file and sending the HUP signal to the postmaster
! * or a backend process. (Notice that the signal receipt will not be
! * evaluated immediately. The postmaster and the backend check it at a
! * certain point in their main loop. It's safer to wait than to read a
! * file asynchronously.)
*
* BACKEND options can only be set at postmaster startup, from the
* configuration file, or by client request in the connection startup
--- 31,40 ----
*
* SIGHUP options can only be set at postmaster startup or by changing
* the configuration file and sending the HUP signal to the postmaster
! * or a backend process. (Notice that the signal receipt will be
! * evaluated immediately only in the postmaster. The backend checks it
! * at a certain point in its main loop. It's safer to wait than to
! * read a file asynchronously.)
*
* BACKEND options can only be set at postmaster startup, from the
* configuration file, or by client request in the connection startup
Code comment patch applied. Thanks.
---------------------------------------------------------------------------
Markus Bertheau wrote:
2006/3/6, Tom Lane <tgl@sss.pgh.pa.us>:
The comment is referring to the control flow in a backend; you're
looking at the postmaster's sighup handler, which is different.Then the following comment patch is appropriate, afaics.
Markus Bertheau
[ Attachment, skipping... ]
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com
+ If your life is a hard drive, Christ can be your backup. +
Bruce Momjian <pgman@candle.pha.pa.us> writes:
Code comment patch applied. Thanks.
The comment was in fact correct as it stood, though in different ways
for the postmaster and backend --- in the postmaster it alludes to the
fact that we only enable signals at one point in the postmaster loop.
regards, tom lane
Tom Lane wrote:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
Code comment patch applied. Thanks.
The comment was in fact correct as it stood, though in different ways
for the postmaster and backend --- in the postmaster it alludes to the
fact that we only enable signals at one point in the postmaster loop.
OK, patch backed out.
--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com
+ If your life is a hard drive, Christ can be your backup. +