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

Re: Improve shutdown during online backup

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Improve shutdown during online backup
Date: 2008-04-01 19:03:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
On Tue, 2008-04-01 at 17:42 +0100, 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.

> * 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.

  Simon Riggs

  PostgreSQL UK 2008 Conference:

In response to


pgsql-hackers by date

Next:From: Gregory StarkDate: 2008-04-01 19:18:18
Subject: Re: ANALYZE getting dead tuple count hopelessly wrong
Previous:From: Paul RamseyDate: 2008-04-01 18:37:40
Subject: Access to Row ID information in Functions

pgsql-patches by date

Next:From: David FetterDate: 2008-04-01 20:06:13
Subject: Re: Consistent \d commands in psql
Previous:From: Simon RiggsDate: 2008-04-01 16:42:21
Subject: Re: Improve shutdown during online backup

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