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

Re: Archiver behavior at shutdown

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Archiver behavior at shutdown
Date: 2007-12-27 21:57:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> ...based upon limitations of the existing system. We have been
> SIGQUIT'ing the archiver, and there is a comment there to say how
> important it is that we *do not* try to finish processing before we
> quit. If you think that comment is wrong, thats OK by me: I can't recall
> the reasoning there, or even if it was my own.

That comment is clearly wrong --- it applies to the SIGTERM situation.

>> Another case that needs some revisiting is the archiver's response
>> to SIGTERM, which is currently SIG_IGN.  Since the postmaster will never
>> send it SIGTERM, we should assume that receipt of SIGTERM means that
>> init is telling us we have N seconds left before system shutdown.
>> Is it a good idea to continue archiving in that situation?  I doubt it
>> --- it seems like we are just asking to get SIGKILL'd partway through a
>> copy step.  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.

> Not sure about that. If there are outstanding files to archive, then it
> probably is important to try to archive them. Mostly this won't be the
> case, but if this was, for example a simple switchover between a primary
> and a warm standby then it might result in data loss.

A simple switchover ought to be done by bringing down the postmaster,
not the whole machine.

The real question here is whether it's sane to try to do archiving on a
machine that is in the midst of shutdown.  As an example, it's quite
likely that NFS mounts are going to go away sometime between SIGTERM and
SIGKILL, if they haven't done so already.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Stephen FrostDate: 2007-12-27 22:13:57
Subject: Re: Spoofing as the postmaster
Previous:From: Magnus HaganderDate: 2007-12-27 21:50:22
Subject: Re: Spoofing as the postmaster

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2007-12-27 22:24:20
Subject: Re: Archiver behavior at shutdown
Previous:From: Simon RiggsDate: 2007-12-27 21:29:11
Subject: Re: Archiver behavior at shutdown

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