Unix Technical Forum

Plan for resetting commented postgresql.conf vars at sighup

This is a discussion on Plan for resetting commented postgresql.conf vars at sighup within the pgsql Hackers forums, part of the PostgreSQL category; --> Hi, this is the plan: In ParseConfigFile, record the fact that the variable was set in response to SIG_HUP ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 01:29 AM
Markus Bertheau
 
Posts: n/a
Default Plan for resetting commented postgresql.conf vars at sighup

Hi,

this is the plan: In ParseConfigFile, record the fact that the
variable was set in response to SIG_HUP in the status field
(GUC_SET_FROM_SIGHUP). After setting all variables in postgresql.conf,
set all variables that can appear in postgresql.conf
(GUC_DISALLOW_IN_FILE), don't have their built-in value still set
(PGC_S_DEFAULT), may be set from postgresql.conf (context not INTERNAL
or POSTMASTER) and weren't set from SIGHUP (GUC_SET_FROM_SIGHUP) to
their built-in default value.

One problem is that set_config_option takes the variable's new value
as a string, and at the moment the built-in values are saved with
their real type (int, bool or double), so I can't call
set_config_option with them. So I want to save the boot_val in
config_generic as a string instead of in config_/type/ as their real
type and change InitializeGUCOptions to set the initial reset_val from
the string in boot_val.

Any flaws?

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 01:29 AM
Tom Lane
 
Posts: n/a
Default Re: Plan for resetting commented postgresql.conf vars at sighup

"Markus Bertheau" <mbertheau.pg@googlemail.com> writes:
> this is the plan: In ParseConfigFile, record the fact that the
> variable was set in response to SIG_HUP in the status field
> (GUC_SET_FROM_SIGHUP). After setting all variables in postgresql.conf,
> set all variables that can appear in postgresql.conf
> (GUC_DISALLOW_IN_FILE), don't have their built-in value still set
> (PGC_S_DEFAULT), may be set from postgresql.conf (context not INTERNAL
> or POSTMASTER) and weren't set from SIGHUP (GUC_SET_FROM_SIGHUP) to
> their built-in default value.


This seems pretty nonrobust, in particular if there's an elog partway
through you will be left with very messed-up state (all the wrong things
will happen next time). Might help to keep the "needs reset" state in
temporary memory instead of the status fields.

> One problem is that set_config_option takes the variable's new value
> as a string,


You should not be thinking in terms of doing this through
set_config_option (its API does not offer any way to reset to default).
So I don't really see the issue here.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:03 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com