Lists: | pgsql-hackers |
---|
From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | SIGHUP during recovery |
Date: | 2009-03-03 07:17:06 |
Message-ID: | 3f0b79eb0903022317t77f7dbacm7bb6210a68df4c3f@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi,
Currently, the startup process ignores SIGHUP.
The attached patch allows the startup process to re-read config file:
when SIGHUP arrives, the startup process also receives the signal
from postmaster and reload the settings in main redo apply loop.
Obviously, this is useful to change the parameters which the startup
process may use (e.g. log_line_prefix, log_checkpoints).
Any comments welcome.
Regards,
--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
Attachment | Content-Type | Size |
---|---|---|
sighup_startup_0303.patch | application/octet-stream | 5.0 KB |
From: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: SIGHUP during recovery |
Date: | 2009-03-04 13:58:21 |
Message-ID: | 49AE88FD.4010907@enterprisedb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Fujii Masao wrote:
> Currently, the startup process ignores SIGHUP.
>
> The attached patch allows the startup process to re-read config file:
> when SIGHUP arrives, the startup process also receives the signal
> from postmaster and reload the settings in main redo apply loop.
> Obviously, this is useful to change the parameters which the startup
> process may use (e.g. log_line_prefix, log_checkpoints).
Thanks, committed.
The fact that bgwriter can run simultaneously with the startup process
makes this more important than before. Otherwise if you change something
like log_line_prefix, bgwriter will use the new setting but startup
process will not.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
From: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
---|---|
To: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> |
Cc: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: SIGHUP during recovery |
Date: | 2009-03-05 09:28:21 |
Message-ID: | 1236245301.31880.137.camel@ebony.2ndQuadrant |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Wed, 2009-03-04 at 15:58 +0200, Heikki Linnakangas wrote:
> Fujii Masao wrote:
> > Currently, the startup process ignores SIGHUP.
> >
> > The attached patch allows the startup process to re-read config file:
> > when SIGHUP arrives, the startup process also receives the signal
> > from postmaster and reload the settings in main redo apply loop.
> > Obviously, this is useful to change the parameters which the startup
> > process may use (e.g. log_line_prefix, log_checkpoints).
>
> Thanks, committed.
>
> The fact that bgwriter can run simultaneously with the startup process
> makes this more important than before. Otherwise if you change something
> like log_line_prefix, bgwriter will use the new setting but startup
> process will not.
Should we reload recovery.conf also?
--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support
From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
---|---|
To: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
Cc: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: SIGHUP during recovery |
Date: | 2009-03-05 10:52:23 |
Message-ID: | 3f0b79eb0903050252u3b3d49c9r97cf3eaed3de9058@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi,
On Thu, Mar 5, 2009 at 6:28 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> Should we reload recovery.conf also?
I think no for now. At least the parameters which specify the recovery target
should not be changed during recovery. On the other hand, restore_command
maybe can be set safely, but I'm not sure if it's really useful at this time.
Or, upcoming HS needs such capability?
BTW, I found that backup.sgml still had the description of log_restartpoints.
Here is the patch to remove it.
Regards,
--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
Attachment | Content-Type | Size |
---|---|---|
remove_log_restartpoints_doc.patch | application/octet-stream | 1.6 KB |
From: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: SIGHUP during recovery |
Date: | 2009-03-05 11:10:21 |
Message-ID: | 1236251421.31880.154.camel@ebony.2ndQuadrant |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Thu, 2009-03-05 at 19:52 +0900, Fujii Masao wrote:
> Hi,
>
> On Thu, Mar 5, 2009 at 6:28 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> > Should we reload recovery.conf also?
>
> I think no for now. At least the parameters which specify the recovery target
> should not be changed during recovery.
Why not?
> On the other hand, restore_command
> maybe can be set safely, but I'm not sure if it's really useful at this time.
Not sure changing those parameters would be a bad thing. Other
parameters can be changed, why not those?
--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support
From: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> |
---|---|
To: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
Cc: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: SIGHUP during recovery |
Date: | 2009-03-05 11:22:34 |
Message-ID: | 49AFB5FA.9060503@enterprisedb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Simon Riggs wrote:
> On Thu, 2009-03-05 at 19:52 +0900, Fujii Masao wrote:
>> Hi,
>>
>> On Thu, Mar 5, 2009 at 6:28 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>>> Should we reload recovery.conf also?
>> I think no for now. At least the parameters which specify the recovery target
>> should not be changed during recovery.
>
> Why not?
I don't see either why it wouldn't work. As long as the new value is
greater than the current point in recovery.
BTW, we now have some extra safeguards (minRecoveryPoint) in place to
prevent you from corrupting your database by moving recovery target
backwards to a point earlier than an already recovery xlog record.
That's not really that relevant to reloading recovery.conf on the fly,
but it's worth noting. The documentation currently says about the
settings in recovery.conf that "They cannot be changed once recovery has
begun." That wording should probably be relaxed.
>> On the other hand, restore_command
>> maybe can be set safely, but I'm not sure if it's really useful at this time.
>
> Not sure changing those parameters would be a bad thing. Other
> parameters can be changed, why not those?
It seems safe to me. It doesn't seem very useful, though. The only
options left in recovery.conf are restore_command, and all the
target-related options. If you want to change those, you can always stop
the server, change the settings and restart; without hot standby there
isn't any other backends active yet that would get upset about the shutdown.
The main reason why reloading the main config file on SIGHUP is a good
idea is that otherwise you get an inconsistency between the background
writer and the startup process.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
From: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: SIGHUP during recovery |
Date: | 2009-03-05 11:26:34 |
Message-ID: | 49AFB6EA.3050207@enterprisedb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Fujii Masao wrote:
> BTW, I found that backup.sgml still had the description of log_restartpoints.
> Here is the patch to remove it.
Thanks, I had put that in the Open Items list so that we remember to do
that before release.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | Simon Riggs <simon(at)2ndquadrant(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: SIGHUP during recovery |
Date: | 2009-03-05 19:50:24 |
Message-ID: | 9576.1236282624@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> BTW, I found that backup.sgml still had the description of log_restartpoints.
> Here is the patch to remove it.
Applied, thanks.
regards, tom lane