Re: Allow interrupts on waiting standby

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow interrupts on waiting standby
Date: 2017-01-27 13:17:19
Message-ID: CAB7nPqQLvbyD0Bm=s8zD1=mbeTPsn4LALy5hxW9t2uoO1Av22Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 27, 2017 at 10:35 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Fri, Jan 27, 2017 at 4:36 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>> On 26 January 2017 at 19:20, Andres Freund <andres(at)anarazel(dot)de> wrote:
>>> On 2017-01-26 12:24:44 -0500, Robert Haas wrote:
>>>> On Thu, Jan 26, 2017 at 7:18 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>>>> > Currently a waiting standby doesn't allow interrupts.
>>>> >
>>>> > Patch implements that.
>>>> >
>>>> > Barring objection, patching today with backpatches.
>>>>
>>>> "today" is a little quick, but the patch looks fine. I doubt anyone's
>>>> going to screech too loud about adding a CHECK_FOR_INTERRUPTS() call.
>>>
>>> I don't quite get asking for agreement, and then not waiting as
>>> suggested. I'm personally fine with going with a CHECK_FOR_INTERRUPTS
>>> for now, but I think it'd better to replace it with a latch.
>>
>> I have waited, so not sure what you mean. Tomorrow is too late.
>
> This gives really little time for any feedback :(
>
>> Replacing with a latch wouldn't be backpatchable, IMHO.
>> I've no problem if you want to work on a deeper fix for future versions.
>
> A deeper fix for HEAD proves to not be that complicated. Please see
> the attached. The other two calls of pg_usleep() in standby.c are
> waiting with 5ms and 10ms, it is not worth switching them to a latch.

Two things I forgot in this patch:
- documentation for the new wait event
- the string for the wait event or this would show up as "???" in
pg_stat_activity.
There are no default clauses in the pgstat_get_wait_* routines so my
compiler is actually complaining...
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2017-01-27 13:18:35 Re: pg_ls_dir & friends still have a hard-coded superuser check
Previous Message Antonin Houska 2017-01-27 13:14:04 Re: Performance improvement for joins where outer side is unique