Re: rare avl shutdown slowness (related to signal handling)

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Qingqing Zhou <zhouqq(dot)postgres(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: rare avl shutdown slowness (related to signal handling)
Date: 2015-04-08 15:34:13
Message-ID: 20150408153413.GR4369@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > Tom Lane wrote:
> >> I think changing the outer "for(;;)" to "while (!got_SIGTERM)" would
> >> be a much safer fix.
>
> > Ah, yeah. I was thinking in changing PG_exception_stack once shutdown
> > was requested, but this is much simpler.
>
> Your proposed patch seems to be doing both of those, which is probably
> unnecessary. I don't object to the SIGHUP test and goto in the error
> path, but I'd put it a lot further down, like after the existing
> RESUME_INTERRUPTS. I doubt it's a good idea to skip the transaction
> cleanup steps.

Ah, of course. See attached patch.

We could keep the "for (;;)" instead of having it conditional on
got_SIGTERM, but I don't think there's any harm in the change.

This is backpatchable to 9.0.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
autovac-shutdown-2.patch text/x-diff 1.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2015-04-08 15:44:17 Re: Support UPDATE table SET(*)=...
Previous Message Jim Nasby 2015-04-08 15:33:59 Re: Removal of FORCE option in REINDEX