Re: [HACKERS] Parallel Hash take II

From: Andres Freund <andres(at)anarazel(dot)de>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Rafia Sabih <rafia(dot)sabih(at)enterprisedb(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Oleg Golovanov <rentech(at)mail(dot)ru>
Subject: Re: [HACKERS] Parallel Hash take II
Date: 2017-11-30 02:31:19
Message-ID: 20171130023119.swcshwtvvunkk3ww@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017-11-30 14:17:51 +1300, Thomas Munro wrote:
> On Mon, Nov 27, 2017 at 10:25 PM, Thomas Munro
> <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> > On Thu, Nov 23, 2017 at 12:36 AM, Thomas Munro
> > <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> >> Here's a new patch set with responses to the last batch of review comments.
> >
> > Rebased on top of the recent SGML->XML change.
>
> Andres asked me off-list how I tested the barrier.c case where a
> backend detaches, releasing other waiters. There are special cases in
> BarrierArriveAndWait() and BarrierDetach() for that to make sure that
> the phase advances and waiters are released if they were only waiting
> for this one backend to arrive, and that exactly one of them is
> "elected" for any serial work. Normally the last to arrive is elected
> (see earlier discussion about why that's a good idea), but if the one
> that would be last detaches instead of arriving then we'll have to
> elect someone else. Here is a throw-away test harness that can be
> used to exercise that case. CREATE EXTENSION test_barrier; SELECT
> test_barrier_detach_releases(1);. Adding a sleep before BarrierDetach
> can be used to influence the race, and adding elog messages to
> barrier.c can be used to see when the special path is taken.

Played some with this, and confirmed that that case
works. Pushed. Interestingly my first few experiments with delaying the
master using pg_usleep() were *not* successful because the leader gets
signalled by the workers successfully having started, interrupting the
sleep...

I've not made any meaningful changes, there was a * missing in an empty
comment line, and I think I've added a single comma.

I do wonder if it's maybe worth adding a single graf about error
handling to the intro? It may not be obvious that this requires
installing a hook calling detach.

- Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-11-30 02:31:53 Re: [HACKERS] compress method for spgist - 2
Previous Message Amit Langote 2017-11-30 02:30:13 Re: [HACKERS] path toward faster partition pruning