Re: HS/SR and smart shutdown - Mailing list pgsql-hackers

From Greg Smith
Subject Re: HS/SR and smart shutdown
Date
Msg-id 4B5811EB.2090102@2ndquadrant.com
Whole thread Raw
In response to Re: HS/SR and smart shutdown  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas wrote:
> It's a good question if that still makes sense with Hot Standby. Perhaps
> we should redefine smart shutdown in standby mode to shut down as soon
> as all read-only connections have died.
>   

I've advocated in the past that an escalating shutdown procedure would 
be helpful in general to have available.  Start kicking off clients with 
smart, continue to fast if there's any left, and if there's still any 
left after that (have seen COPY clients that ignore fast) disconnect 
them and go to immediate to completely kill them.  Once you've started 
the server on the road to shutdown, even with smart, you've basically 
committed to going all the way down by whatever means is available 
anyway, so why not make that more automated and easier.

If something like that were available, I could see inserting a step in 
the middle there specifically aimed at resolving this issue.  Maybe it's 
just a change to the beginning of fast shutdown, or to the end of smart 
as I think you're suggesting.  Perhaps you only get it if you do one of 
these escalating shutdowns I'm proposing, making that the preferred way 
to handle HS servers.

-- 
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Takahiro Itagaki
Date:
Subject: Re: About "Our CLUSTER implementation is pessimal" patch
Next
From: Matteo Beccati
Date:
Subject: Re: WARNING: pgstat wait timeout