Re: Autovacuum worker doesn't immediately exit on postmaster death

2021-03-30 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > * Stephen Frost (sfr...@snowman.net) wrote: > > * Michael Paquier (mich...@paquier.xyz) wrote: > > > On Mon, Mar 22, 2021 at 04:07:12PM -0400, Robert Haas wrote: > > > > On Mon, Mar 22, 2021 at 1:48 PM Stephen Frost > > > > wrote: > > > >>

Re: Autovacuum worker doesn't immediately exit on postmaster death

2021-03-28 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > * Michael Paquier (mich...@paquier.xyz) wrote: > > On Mon, Mar 22, 2021 at 04:07:12PM -0400, Robert Haas wrote: > > > On Mon, Mar 22, 2021 at 1:48 PM Stephen Frost wrote: > > >> Thanks for that. Attached is just a rebased version with a co

Re: Autovacuum worker doesn't immediately exit on postmaster death

2021-03-24 Thread Stephen Frost
Greetings, * Michael Paquier (mich...@paquier.xyz) wrote: > On Mon, Mar 22, 2021 at 04:07:12PM -0400, Robert Haas wrote: > > On Mon, Mar 22, 2021 at 1:48 PM Stephen Frost wrote: > >> Thanks for that. Attached is just a rebased version with a commit > >> message added. If there aren't any other

Re: Autovacuum worker doesn't immediately exit on postmaster death

2021-03-23 Thread Michael Paquier
On Mon, Mar 22, 2021 at 04:07:12PM -0400, Robert Haas wrote: > On Mon, Mar 22, 2021 at 1:48 PM Stephen Frost wrote: >> Thanks for that. Attached is just a rebased version with a commit >> message added. If there aren't any other concerns, I'll commit this in >> the next few days and back-patch i

Re: Autovacuum worker doesn't immediately exit on postmaster death

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 1:48 PM Stephen Frost wrote: > Thanks for that. Attached is just a rebased version with a commit > message added. If there aren't any other concerns, I'll commit this in > the next few days and back-patch it. When it comes to 12 and older, > does anyone want to opine abo

Re: Autovacuum worker doesn't immediately exit on postmaster death

2021-03-22 Thread Stephen Frost
Greetings, * Thomas Munro (thomas.mu...@gmail.com) wrote: > On Fri, Dec 11, 2020 at 7:57 AM Stephen Frost wrote: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > > > The if-we're-going-to-delay-anyway path in vacuum_delay_point seems > > > OK to add a touch more overhead to, though. > > > > Alright,

Re: Autovacuum worker doesn't immediately exit on postmaster death

2021-02-22 Thread Thomas Munro
On Fri, Dec 11, 2020 at 7:57 AM Stephen Frost wrote: > * Tom Lane (t...@sss.pgh.pa.us) wrote: > > The if-we're-going-to-delay-anyway path in vacuum_delay_point seems > > OK to add a touch more overhead to, though. > > Alright, for this part at least, seems like it'd be something like the > attache

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-12-10 Thread Thomas Munro
On Fri, Dec 11, 2020 at 8:34 AM Robert Haas wrote: > On Thu, Oct 29, 2020 at 5:36 PM Alvaro Herrera > wrote: > > Maybe instead of thinking specifically in terms of vacuum, we could > > count buffer accesses (read from kernel) and check the latch once every > > 1000th such, or something like that

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-12-10 Thread Robert Haas
On Thu, Oct 29, 2020 at 5:36 PM Alvaro Herrera wrote: > Maybe instead of thinking specifically in terms of vacuum, we could > count buffer accesses (read from kernel) and check the latch once every > 1000th such, or something like that. Then a very long query doesn't > have to wait until it's run

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-12-10 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Alvaro Herrera writes: > > On 2020-Oct-29, Stephen Frost wrote: > >> I do think it'd be good to find a way to check every once in a while > >> even when we aren't going to delay though. Not sure what the best > >> answer there is. > > > Maybe

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-30 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Alvaro Herrera writes: > > On 2020-Oct-29, Stephen Frost wrote: > >> I do think it'd be good to find a way to check every once in a while > >> even when we aren't going to delay though. Not sure what the best > >> answer there is. > > > Maybe

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Oct-29, Stephen Frost wrote: >> I do think it'd be good to find a way to check every once in a while >> even when we aren't going to delay though. Not sure what the best >> answer there is. > Maybe instead of thinking specifically in terms of vacuum, we could > c

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Alvaro Herrera
On 2020-Oct-29, Stephen Frost wrote: > I do think it'd be good to find a way to check every once in a while > even when we aren't going to delay though. Not sure what the best > answer there is. Maybe instead of thinking specifically in terms of vacuum, we could count buffer accesses (read from

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Stephen Frost
Greetings, * Andres Freund (and...@anarazel.de) wrote: > On 2020-10-29 12:27:53 -0400, Tom Lane wrote: > > Maybe put a check into vacuum_delay_point, and poll the pipe when we're > > about to sleep anyway? > > Perhaps we should just replace the pg_usleep() with a latch wait? I'm not sure why, bu

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Andres Freund
Hi, On 2020-10-29 12:27:53 -0400, Tom Lane wrote: > Maybe put a check into vacuum_delay_point, and poll the pipe when we're > about to sleep anyway? Perhaps we should just replace the pg_usleep() with a latch wait? Greetings, Andres Freund

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Alvaro Herrera
On 2020-Oct-28, Alexander Kukushkin wrote: > Hello, > > I know, nobody in their mind should do that, but, if the postmaster > process is killed with SIGKILL signal, most backend processes > correctly notice the fact of the postmaster process absence and exit. > There is one exception though, when

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Alvaro Herrera
On 2020-Oct-29, Stephen Frost wrote: > > It's hard to do better than that, because on most platforms there's > > no way to get a signal on parent-process death, so the only way to > > notice would be to poll the postmaster-death pipe constantly; which > > would be hugely expensive in comparison to

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Tom Lane
Stephen Frost writes: > I agree that 'constantly' wouldn't be great, but with some periodicity > that's more frequent than 'not until a few hours later when we finally > finish vacuuming this relation' would be nice. At least with autovauum > we may be periodically sleeping anyway so it doesn't s

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Victor Yegorov writes: > > ср, 28 окт. 2020 г. в 19:44, Alexander Kukushkin : > >> I know, nobody in their mind should do that, but, if the postmaster > >> process is killed with SIGKILL signal, most backend processes > >> correctly notice the f

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-28 Thread Tom Lane
Victor Yegorov writes: > ср, 28 окт. 2020 г. в 19:44, Alexander Kukushkin : >> I know, nobody in their mind should do that, but, if the postmaster >> process is killed with SIGKILL signal, most backend processes >> correctly notice the fact of the postmaster process absence and exit. >> There is o

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-28 Thread Victor Yegorov
ср, 28 окт. 2020 г. в 19:44, Alexander Kukushkin : > I know, nobody in their mind should do that, but, if the postmaster > process is killed with SIGKILL signal, most backend processes > correctly notice the fact of the postmaster process absence and exit. > There is one exception though, when the