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

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Victor Yegorov <vyegorov(at)gmail(dot)com>, Alexander Kukushkin <cyberdemn(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Autovacuum worker doesn't immediately exit on postmaster death
Date: 2020-10-29 16:32:27
Message-ID: 20201029163227.GA20322@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 the value.
>
> 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 seem like polling
> at that point would really be terrible, though it'd be nice to check
> every once in a while even if we aren't sleeping.

vacuum_delay_point seems an obvious candidate, as soon as we've
determined that the sleep interval is > 0; since we're going to sleep,
the cost of a syscall seems negligible. I'm not sure what to suggest
for vacuums that don't have vacuum costing active, though.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-10-29 16:35:07 Re: Autovacuum worker doesn't immediately exit on postmaster death
Previous Message Tom Lane 2020-10-29 16:27:53 Re: Autovacuum worker doesn't immediately exit on postmaster death