Re: bug in SignalSomeChildren

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bug in SignalSomeChildren
Date: 2010-12-22 01:23:26
Message-ID: AANLkTi=mrC6HWQ1mXQthZRWaZVDd+ujsz-VBzJ__xHbk@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 18, 2010 at 1:00 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Dec 17, 2010 at 10:27 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>>> I think the attached might be a little tidier.  Thoughts?
>>
>> I'm not really thrilled at the idea of calling
>> IsPostmasterChildWalSender for every child whether or not it will have
>> any impact on the decision.  That involves touching shared memory which
>> can be rather expensive (see previous discussions about shared cache
>> lines and so forth).
>
> The existing code already does that, unless I'm missing something.  We
> could improve on my proposed patch a bit by doing the is_autovacuum
> test first and the walsender test second.  I'm not sure how to improve
> on it beyond that.

How about doing target != ALL test at the head for the most common case
(target == ALL)? I added that test into your patch and changed it so that the
is_autovacuum test is done first.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
signal-some-children-v2.patch application/octet-stream 1.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-12-22 01:24:12 Re: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Previous Message Merlin Moncure 2010-12-22 00:56:46 Re: How much do the hint bits help?