Re: [HACKERS] Parallel Append implementation

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] Parallel Append implementation
Дата
Msg-id CA+TgmoaU9MJ2CzdeS3d3+ETtJYEhuZtp58NpT+S9NgjnMDsRCw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Parallel Append implementation  (amul sul <sulamul@gmail.com>)
Ответы Re: [HACKERS] Parallel Append implementation  (Amit Khandekar <amitdkhan.pg@gmail.com>)
Re: [HACKERS] Parallel Append implementation  (Adrien Nayrat <adrien.nayrat@anayrat.info>)
Список pgsql-hackers
On Tue, Nov 28, 2017 at 6:02 AM, amul sul <sulamul@gmail.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.

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: explain analyze output with parallel workers - question aboutmeaning of information for explain.depesz.com
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Proposal: Local indexes for partitioned table