Re: [HACKERS] Parallel Append implementation

From: Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: amul sul <sulamul(at)gmail(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Rafia Sabih <rafia(dot)sabih(at)enterprisedb(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Parallel Append implementation
Date: 2017-12-06 10:21:13
Message-ID: CAJ3gD9cs_ChsrB4cf5G75WtNh9DSKjD=b7juw-XUV-dbAnjifg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6 December 2017 at 04:01, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Tue, Nov 28, 2017 at 6:02 AM, amul sul <sulamul(at)gmail(dot)com> wrote:
>> Here are the changes I did on v21 patch to handle crash reported by Rajkumar[1]:
>>
>> diff --git a/src/backend/executor/nodeAppend.c
>> b/src/backend/executor/nodeAppend.c
>> index e3b17cf0e2..e0ee918808 100644
>> --- a/src/backend/executor/nodeAppend.c
>> +++ b/src/backend/executor/nodeAppend.c
>> @@ -479,9 +479,12 @@ choose_next_subplan_for_worker(AppendState *node)
>> pstate->pa_next_plan = append->first_partial_plan;
>> else
>> pstate->pa_next_plan++;
>> - if (pstate->pa_next_plan == node->as_whichplan)
>> +
>> + if (pstate->pa_next_plan == node->as_whichplan ||
>> + (pstate->pa_next_plan == append->first_partial_plan &&
>> + append->first_partial_plan >= node->as_nplans))
>> {
>> - /* We've tried everything! */
>> + /* We've tried everything or there were no partial plans */
>> pstate->pa_next_plan = INVALID_SUBPLAN_INDEX;
>> LWLockRelease(&pstate->pa_lock);
>> return false;
>
> I changed this around a little, added a test case, and committed this.

Thanks Robert !

The crash that is reported on pgsql-committers, is being discussed on
that list itself.

>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company

--
Thanks,
-Amit Khandekar
EnterpriseDB Corporation
The Postgres Database Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Anthony Bykov 2017-12-06 11:40:54 Re: Jsonb transform for pl/python
Previous Message Amit Khandekar 2017-12-06 10:01:44 Re: pgsql: Support Parallel Append plan nodes.