Re: [RFC] Should we fix postmaster to avoid slow shutdown? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [RFC] Should we fix postmaster to avoid slow shutdown?
Date
Msg-id b236f233-5856-7522-9e90-32c2c788f4f0@2ndquadrant.com
Whole thread Raw
In response to Re: [RFC] Should we fix postmaster to avoid slow shutdown?  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
Responses Re: [RFC] Should we fix postmaster to avoid slow shutdown?
List pgsql-hackers
On 9/27/16 11:07 PM, Tsunakawa, Takayuki wrote:
>> From: pgsql-hackers-owner@postgresql.org
>> [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Tom Lane
>> Allowing SIGQUIT to prompt fast shutdown of the stats collector seems sane,
>> though.  Try to make sure it doesn't leave partly-written stats files
>> behind.
> 
> The attached patch based on HEAD does this.  I'd like this to be back-patched because one of our important customers
uses9.2.
 
> 
> I didn't remove partially written stat files on SIGQUIT for the following reasons.  Is this OK?
> 
> 1. The recovery at the next restart will remove the stat files.
> 2. SIGQUIT processing should be as fast as possible.
> 3. If writing stats files took long due to the OS page cache flushing, removing files might be forced to wait
likewise.

ISTM that this would change the "immediate shutdown" to not save stats
files anymore.  So far, all the shutdown modes are equivalent in terms
of how they preserve data and system state.  They differ only in when
the hard work happens.  This would be a deviation from that principle.

Child processes don't distinguish between a SIGQUIT coming from a
user-initiated immediate shutdown request and a crash-induced
kill-everyone directive.  So there might not be a non-ugly way to
address that.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: Parallel execution and prepared statements
Next
From: Tom Lane
Date:
Subject: Re: [RFC] Should we fix postmaster to avoid slow shutdown?