pg_ctl default shutdown mode

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_ctl default shutdown mode
Date: 2001-02-08 16:45:38
Message-ID: Pine.LNX.4.30.0102081739080.1362-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Now that waiting for shutdown is the default, it seems that the default
shutdown mode should also be one where there's a high chance of the
shutdown actually happening. As it stands, if there are connected
clients, pg_ctl will wait for 60 or so seconds before proclaiming that the
postmaster won't shut down. This is not intuitive.

The signal is still delivered, though, so the postmaster may silently shut
down at any later time. This can cause confusion.

While the "smart" shutdown is a cute feature, a *stop* script should
really stop the thing by default and allow the unusual behaviour to be
selected with an option.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_ctl default shutdown mode
Date: 2001-02-10 01:01:05
Message-ID: Pine.LNX.4.30.0102100159230.1286-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Since there were no comments, I'm going to make fast shutdown the default.

I wrote:

> Now that waiting for shutdown is the default, it seems that the default
> shutdown mode should also be one where there's a high chance of the
> shutdown actually happening. As it stands, if there are connected
> clients, pg_ctl will wait for 60 or so seconds before proclaiming that the
> postmaster won't shut down. This is not intuitive.
>
> The signal is still delivered, though, so the postmaster may silently shut
> down at any later time. This can cause confusion.
>
> While the "smart" shutdown is a cute feature, a *stop* script should
> really stop the thing by default and allow the unusual behaviour to be
> selected with an option.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/


From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: "PostgreSQL Development" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Re: pg_ctl default shutdown mode
Date: 2001-02-10 06:35:35
Message-ID: EKEJJICOHDIEMGPNIFIJMEPODIAA.Inoue@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> -----Original Message-----
> From: Peter Eisentraut
>
> Since there were no comments, I'm going to make fast shutdown the default.
>

Oh I've misunderstood.
I object to the change.

Regards,
Hiroshi Inoue


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Re: pg_ctl default shutdown mode
Date: 2001-02-10 09:20:35
Message-ID: Pine.LNX.4.30.0102101019470.775-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hiroshi Inoue writes:

> > Since there were no comments, I'm going to make fast shutdown the default.
> >
>
> Oh I've misunderstood.
> I object to the change.

Do you feel the current behaviour is more intuitive? Just curious. I
just think that waiting by default and smart shutdown don't really mix
well.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/


From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: "PostgreSQL Development" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Re: pg_ctl default shutdown mode
Date: 2001-02-10 14:22:08
Message-ID: EKEJJICOHDIEMGPNIFIJAEAKDJAA.Inoue@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> -----Original Message-----
> From: Peter Eisentraut [mailto:peter_e(at)gmx(dot)net]
>
> Hiroshi Inoue writes:
>
> > > Since there were no comments, I'm going to make fast shutdown
> the default.
> > >
> >
> > Oh I've misunderstood.
> > I object to the change.
>
> Do you feel the current behaviour is more intuitive?

Yes.

> Just curious. I
> just think that waiting by default and smart shutdown don't really mix
> well.
>

Current behavior prevents manual shutdown from cancelling
running sessions carelessly.
OTOH it's the dba's responsibilty to write appropriate shutdown
scripts and it's not good to rely on default in writing them in the
first place.

Regards,
Hiroshi Inoue


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: pg_ctl default shutdown mode
Date: 2001-02-10 15:17:15
Message-ID: 200102101517.KAA21998@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> > Just curious. I
> > just think that waiting by default and smart shutdown don't really mix
> > well.
> >
>
> Current behavior prevents manual shutdown from cancelling
> running sessions carelessly.
> OTOH it's the dba's responsibilty to write appropriate shutdown
> scripts and it's not good to rely on default in writing them in the
> first place.

Yes, but too many people do stupid things. If they are smart enough to
write a script, they are smart enough to use a flag to make it do what
they want it to do.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "PostgreSQL Development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: pg_ctl default shutdown mode
Date: 2001-02-10 16:51:09
Message-ID: 3817.981823869@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> writes:
>> From: Peter Eisentraut [mailto:peter_e(at)gmx(dot)net]
>> Just curious. I
>> just think that waiting by default and smart shutdown don't really mix
>> well.

> Current behavior prevents manual shutdown from cancelling
> running sessions carelessly.

Seems that pg_ctl is being made to serve two different purposes:
one, manual shutdown, and two, automated shutdown during system-wide
shutdown. In the second case, 'fast' shutdown is the appropriate thing,
but in the first case I think 'smart' shutdown is definitely the safer
and more appropriate default.

So, how to resolve that conflict? I think it's better for the script
default to cater to the manual-invocation case, because you're more
likely to forget to add the switch when you're entering the command by
hand. When pg_ctl is invoked from a system shutdown script, you only
have to get it right once, and then the script remembers for you ;-).

In short: I agree with Hiroshi on this one. Let's leave the script
default at 'smart' shutdown, and make it clear in the documentation
that "-mode fast" is the best way to invoke it from a system-shutdown
script.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: pg_ctl default shutdown mode
Date: 2001-02-10 17:06:31
Message-ID: 200102101706.MAA03484@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> So, how to resolve that conflict? I think it's better for the script
> default to cater to the manual-invocation case, because you're more
> likely to forget to add the switch when you're entering the command by
> hand. When pg_ctl is invoked from a system shutdown script, you only
> have to get it right once, and then the script remembers for you ;-).
>
> In short: I agree with Hiroshi on this one. Let's leave the script
> default at 'smart' shutdown, and make it clear in the documentation
> that "-mode fast" is the best way to invoke it from a system-shutdown
> script.

Agreed. Default to the best mode for manual usage.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026