Re: Hot standby, recovery infra

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hot standby, recovery infra
Date: 2009-01-31 20:41:26
Message-ID: 4984B776.4050807@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> On Fri, 2009-01-30 at 16:55 +0200, Heikki Linnakangas wrote:
>> Ok, here's an attempt to make shutdown work gracefully.
>>
>> Startup process now signals postmaster three times during startup: first
>> when it has done all the initialization, and starts redo. At that point.
>> postmaster launches bgwriter, which starts to perform restartpoints when
>> it deems appropriate. The 2nd time signals when we've reached consistent
>> recovery state. As the patch stands, that's not significant, but it will
>> be with all the rest of the hot standby stuff. The 3rd signal is sent
>> when startup process has finished recovery. Postmaster used to wait for
>> the startup process to exit, and check the return code to determine
>> that, but now that we support shutdown, startup process also returns
>> with 0 exit code when it has been requested to terminate.
>
> Yeh, seems much cleaner.
>
> Slightly bizarre though cos now we're pretty much back to my originally
> proposed design. C'est la vie.

Yep. I didn't see any objections to that approach in the archives. There
was other problems in the early versions of the patch, but nothing
related to this arrangement.

> I like this way because it means we might in the future get Startup
> process to perform post-recovery actions also.

Yeah, it does. Do you have something in mind already?

> Your call to PMSIGNAL_RECOVERY_COMPLETED needs to be if
> (IsUnderPostmaster), or at least a comment to explain why not or perhaps
> an Assert.

Nah, StartupProcessMain is only run under postmaster; you don't want to
install signal handlers in a stand-along backend. Stand-alone backend
calls StartupXLOG directly.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-01-31 21:21:30 Re: [PATCH] Space reservation v02
Previous Message Heikki Linnakangas 2009-01-31 20:32:43 Re: Hot standby, recovery infra