pg_ctl stop -m fast after -m smart

Lists: pgsql-hackers
From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_ctl stop -m fast after -m smart
Date: 2009-08-07 01:31:51
Message-ID: 20090807102027.9792.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


"pg_ctl stop -m smart" will wait for all connections are disconnected and
"pg_ctl stop -m fast" will disconnect all connections forcibly.
But "fast" after "smart" also wait for disconnections.

Can we change the behavior that "fast" overwrites "smart" mode?
I'd like to achieve the following sequence:
$ pg_ctl stop
$ (found some connections remain)
$ [Ctrl+C]
$ pg_ctl stop -m fast
$ (force disconnect and stop server safely)

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_ctl stop -m fast after -m smart
Date: 2009-08-07 03:43:18
Message-ID: 3f0b79eb0908062043q38699e18k3d06783fd2e8231f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On Fri, Aug 7, 2009 at 10:31 AM, Itagaki
Takahiro<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
>
> "pg_ctl stop -m smart" will wait for all connections are disconnected and
> "pg_ctl stop -m fast" will disconnect all connections forcibly.
> But "fast" after "smart" also wait for disconnections.
>
> Can we change the behavior that "fast" overwrites "smart" mode?

+1. This behavior was supported in 8.2 or before, but broken in 8.3.
Here is the patch. This should be backported to 8.3 and 8.4.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
fast_shutdown.patch application/octet-stream 605 bytes

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_ctl stop -m fast after -m smart
Date: 2009-08-07 06:00:59
Message-ID: 4A7BC31B.6040304@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii Masao wrote:
> On Fri, Aug 7, 2009 at 10:31 AM, Itagaki
> Takahiro<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
>> "pg_ctl stop -m smart" will wait for all connections are disconnected and
>> "pg_ctl stop -m fast" will disconnect all connections forcibly.
>> But "fast" after "smart" also wait for disconnections.
>>
>> Can we change the behavior that "fast" overwrites "smart" mode?
>
> +1. This behavior was supported in 8.2 or before, but broken in 8.3.
> Here is the patch. This should be backported to 8.3 and 8.4.

Thanks, applied.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_ctl stop -m fast after -m smart
Date: 2009-08-07 14:17:16
Message-ID: 20070.1249654636@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> Takahiro<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
>> Can we change the behavior that "fast" overwrites "smart" mode?

> +1. This behavior was supported in 8.2 or before, but broken in 8.3.
> Here is the patch. This should be backported to 8.3 and 8.4.

I think this was my fault :-(. Thanks for the fix.

regards, tom lane