Re: Assumptions about the number of parallel workers - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Assumptions about the number of parallel workers
Date
Msg-id 20200207182843.p2eijgvo4zuvxa32@alap3.anarazel.de
Whole thread Raw
In response to Re: Assumptions about the number of parallel workers  (Antonin Houska <ah@cybertec.at>)
List pgsql-hackers
Hi,

On 2020-02-07 09:44:34 +0100, Antonin Houska wrote:
> Those Gather nodes still have non-zero num_workers, see this part of
> standard_planner:
> 
>     if (force_parallel_mode != FORCE_PARALLEL_OFF && top_plan->parallel_safe)
>     {
>     ...
>         gather->num_workers = 1;
>     gather->single_copy = true;

Ick. Looks like you might be right...


> Also, if it num_workers was zero for any reason, my patch would probably make
> regression tests fail. However I haven't noticed any assertion failure.

That however, is not at all guaranteed. The regression tests don't run
(or at least not much) with force_parallel_mode set. You can try
yourself though, with something like

PGOPTIONS='-c force_parallel_mode=regress' make check

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Internal key management system
Next
From: Andres Freund
Date:
Subject: Re: logical decoding : exceeded maxAllocatedDescs for .spill files