Re: [RFC] Should we fix postmaster to avoid slow shutdown?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, "'Robert Haas'" <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [RFC] Should we fix postmaster to avoid slow shutdown?
Date: 2016-11-18 16:27:40
Message-ID: 20425.1479486460@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> 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.

There is that. Up to now, an immediate shutdown request didn't cause
any actual data loss, but now it would. Maybe that's a reason to reject
this whole concept. (Upthread I was thinking that's a behavior we have
anyway, but really we don't: a look through pgstats.c shows that it will
never exit without attempting to write the stats, short of a crash of
the stats collector process itself.)

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

It doesn't seem to me that it's a matter of whether the signaling is
adequate; we could fix that. It's a matter of whether you're willing to
have "pg_ctl stop -m immediate" lose stats data.

Although the stats collector was originally conceived as optional,
we depend on it enough now for autovacuum that I'm not sure it'd be a
good thing to have a popularly-used shutdown mode that loses the stats.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-11-18 16:37:52 Re: [RFC] Should we fix postmaster to avoid slow shutdown?
Previous Message Peter Eisentraut 2016-11-18 15:49:11 Re: [RFC] Should we fix postmaster to avoid slow shutdown?