On Wed, Apr 5, 2017 at 5:34 PM, Kuntal Ghosh <kuntalghosh.2...@gmail.com>
 wrote:

> On Tue, Apr 4, 2017 at 12:16 PM, Neha Khatri <nehakhat...@gmail.com>
> wrote:
>
> > I feel there should be an assert if
> >     (BackgroundWorkerData->parallel_register_count -
> > BackgroundWorkerData->parallel_terminate_count) > max_parallel_workers)
> >
> Backend 1 > SET max_parallel_worker = 8;
> Backend 1 > Execute a long running parallel query q1 with number of
> parallel worker spawned is say, 4.
> Backend 2> SET max_parallel_worker = 3;
> Backend 2 > Execute a long running parallel query q2 with number of
> parallel worker spawned > 0.
>
> The above assert statement will bring down the server unnecessarily
> while executing q2.


Right, with multiple backends trying to fiddle with max_parallel_workers,
that might bring the server down with the said assert:
    Assert(parallel_register_count - parallel_terminate_count <=
max_parallel_workers)

The problem here seem to be the change in the max_parallel_workers value while
the parallel workers are still under execution. So this poses two questions:

1. From usecase point of view, why could there be a need to tweak the
max_parallel_workers exactly at the time when the parallel workers are at
play.
2. Could there be a restriction on tweaking of max_parallel_workers while
the parallel workers are at play? At least do not allow setting the
max_parallel_workers less than the current # of active parallel workers.

Regards,
Neha

Reply via email to