Skip site navigation (1) Skip section navigation (2)

Re: Improve shutdown during online backup

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Simon Riggs *EXTERN*" <simon(at)2ndquadrant(dot)com>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Improve shutdown during online backup
Date: 2008-04-02 07:11:59
Message-ID: D960CB61B694CF459DCFB4B0128514C201F3E8CC@exadv11.host.magwien.gv.at (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Simon Riggs wrote:
>> Few comments:
>> 
>> * smart shutdown waits for sessions to complete, yet this just ignores
>> smart shutdowns which is something a little different. I think we 
>> should wait for the backup to complete and then shutdown.

That would be more consistent, I agree.

I'll undo my changes to pg_ctl as well, as they make no more sense then.

>> * The #defines at top of postmaster.c are duplicated from xlog.c
>> If we can't agree on a common header file then we should at least add a
>> comment to mention they are duplicated (in both locations).
> 
> If we add a function called something like BackupInProgress() 
> to xlog.c,
> exported via miscadmin.h then we can use it within the
> PostmasterStateMachine() function like this
> 
> 	if (pmState == PM_WAIT_BACKENDS)
> 	{
> 		if (CountChildren() == 0 &&
> 			StartupPID == 0 &&
> 			(BgWriterPID == 0 || !FatalError) &&
> 			WalWriterPID == 0 &&
> 			AutoVacPID == 0 &&
> 			!BackupInProgress())   <---- new line
> 
> so that the postmaster doesn't need to know about how we do backups.
> 
> That way you don't need any of the special cases in your patch, nor is
> there any need to duplicate the #defines.

I realized that duplicating the #defines was ugly, and will do it
like that.

Thanks for the hints.

Yours,
Laurenz Albe

In response to

pgsql-hackers by date

Next:From: NikhilSDate: 2008-04-02 07:23:27
Subject: Re: Problem identifying constraints which should not be inherited
Previous:From: James MansionDate: 2008-04-02 06:21:26
Subject: notify with payload (pgkill, notify)

pgsql-patches by date

Next:From: Magnus HaganderDate: 2008-04-02 08:12:35
Subject: Re: Consistent \d commands in psql
Previous:From: Pavel StehuleDate: 2008-04-02 04:54:18
Subject: Re: actualized SQL/PSM patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group