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

Re: Archiver behavior at shutdown

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Archiver behavior at shutdown
Date: 2007-12-27 22:24:20
Message-ID: 20071227222420.GA5659@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:

> ISTM the postmaster should leave the archiver alone at the
> PM_WAIT_BACKENDS -> PM_SHUTDOWN transition, and instead send it
> a WAKEN signal (SIGUSR1) when it sees normal exit of the bgwriter.
> That will afford an opportunity to archive anything that was pushed
> out during the shutdown checkpoint.

What does postmaster do then?  Sleep until archiver is done, or exit
immediately and hope that the archiver goes away as soon as it finishes?
If the former, then we open the possibility that postmaster lives far
too long before system shutdown decides to SIGKILL it.  If the latter,
then a subsequent postmaster start could initiate a second archiver
process which would cause issues with whatever the first archiver is
doing.

I think your proposal to handle SIGTERM could also be used whenever
postmaster has been asked for shutdown (except smart shutdown,
perhaps?):

> I suggest that the response to SIGTERM ought to be to finish
> out the current copy operation (if possible) but then quit without
> initiating any new ones.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-12-27 22:29:29
Subject: Re: Archiver behavior at shutdown
Previous:From: Magnus HaganderDate: 2007-12-27 22:19:29
Subject: Re: Spoofing as the postmaster

pgsql-patches by date

Next:From: Tom LaneDate: 2007-12-27 22:29:29
Subject: Re: Archiver behavior at shutdown
Previous:From: Tom LaneDate: 2007-12-27 21:57:00
Subject: Re: Archiver behavior at shutdown

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