BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather

Lists: pgsql-bugs
From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: kline(dot)christopher(at)gmail(dot)com
Subject: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather
Date: 2024-02-14 22:11:14
Message-ID: 18343-3a5e903d1d3692ab@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18343
Logged by: Christopher Kline
Email address: kline(dot)christopher(at)gmail(dot)com
PostgreSQL version: 14.11
Operating system: Windows 10 x64
Description:

In the default postgresql.conf that is generated, there are the following
lines:

#max_worker_processes = 8 # (change requires restart)
#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers
<<<<<<<<<<<<<<<<<<<<<<<< THIS
#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers
max_parallel_workers = 8 # maximum number of max_worker_processes that
# can be used in parallel operations

it indicates that the default value is taken from whatever
max_parallel_workers is. However, if I start postgresql with those settings
and issue a query of
SELECT setting, unit FROM pg_settings WHERE name =
'max_parallel_workers_per_gather'

the result I get is '2', not '8'.

This leads me to believe that either there is a bug in the code that's not
setting the correct default, or the comment in postgresql.conf is incorrect.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kline(dot)christopher(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather
Date: 2024-02-15 15:55:10
Message-ID: 3258900.1708012510@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> In the default postgresql.conf that is generated, there are the following
> lines:

> #max_worker_processes = 8 # (change requires restart)
> #max_parallel_workers_per_gather = 2 # taken from max_parallel_workers
> <<<<<<<<<<<<<<<<<<<<<<<< THIS
> #max_parallel_maintenance_workers = 2 # taken from max_parallel_workers
> max_parallel_workers = 8 # maximum number of max_worker_processes that
> # can be used in parallel operations

> it indicates that the default value is taken from whatever
> max_parallel_workers is.

No, you're misreading it. There's no magic connection between these
two settings. What the comment means to say is that the per-gather
worker processes come out of a pool of at most max_parallel_workers
processes. Perhaps another wording would be better, but we don't have
a lot of space here --- any thoughts?

regards, tom lane


From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: kline(dot)christopher(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather
Date: 2024-02-15 16:10:00
Message-ID: CAKFQuwajwK-BT40icc4EdosjNbXyF+otfdjFN9Q6uGMwC6tH7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: PostgreSQL : PostgreSQL 메일 링리스트 : 2024-02-15 이후 PGSQL 토토 베이 16:10

On Thu, Feb 15, 2024 at 8:55 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> > In the default postgresql.conf that is generated, there are the following
> > lines:
>
> > #max_worker_processes = 8 # (change requires restart)
> > #max_parallel_workers_per_gather = 2 # taken from max_parallel_workers
> > <<<<<<<<<<<<<<<<<<<<<<<< THIS
> > #max_parallel_maintenance_workers = 2 # taken from max_parallel_workers
> > max_parallel_workers = 8 # maximum number of
> max_worker_processes that
> > # can be used in parallel
> operations
>
> > it indicates that the default value is taken from whatever
> > max_parallel_workers is.
>
> No, you're misreading it. There's no magic connection between these
> two settings. What the comment means to say is that the per-gather
> worker processes come out of a pool of at most max_parallel_workers
> processes. Perhaps another wording would be better, but we don't have
> a lot of space here --- any thoughts?
>
> max_parallel workers = 8 # allocated from max_worker_processes

max_parallel_*_workers = N # allocated from max_parallel_workers

or maybe "consumed from ..."

Or

max_parallel_*_workers = N # capped at max_parallel_workers

The last one turns a process-oriented description into a constraint, the
latter seems to fit better in a config file.

David J.


From: Christopher Kline <kline(dot)christopher(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather
Date: 2024-02-15 16:29:32
Message-ID: CAArmHzSFsTQ3bPX31zDHYSMz_PiHostGKPBp7qM+WU0uz3g6OQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg사설 토토 사이트SQL : Postg사설 토토 사이트SQL 메일 링리스트 : 2024-02-15 이후 PGSQL-BUGS 16:29

Thank you all for the clarification. I like David Johnston's suggestion of

# capped at max_parallel_workers

That clearly defines the constraint.

On Thu, Feb 15, 2024 at 11:10 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Thu, Feb 15, 2024 at 8:55 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
>> > In the default postgresql.conf that is generated, there are the
>> following
>> > lines:
>>
>> > #max_worker_processes = 8 # (change requires restart)
>> > #max_parallel_workers_per_gather = 2 # taken from max_parallel_workers
>> > <<<<<<<<<<<<<<<<<<<<<<<< THIS
>> > #max_parallel_maintenance_workers = 2 # taken from max_parallel_workers
>> > max_parallel_workers = 8 # maximum number of
>> max_worker_processes that
>> > # can be used in parallel
>> operations
>>
>> > it indicates that the default value is taken from whatever
>> > max_parallel_workers is.
>>
>> No, you're misreading it. There's no magic connection between these
>> two settings. What the comment means to say is that the per-gather
>> worker processes come out of a pool of at most max_parallel_workers
>> processes. Perhaps another wording would be better, but we don't have
>> a lot of space here --- any thoughts?
>>
>> max_parallel workers = 8 # allocated from max_worker_processes
>
> max_parallel_*_workers = N # allocated from max_parallel_workers
>
> or maybe "consumed from ..."
>
> Or
>
> max_parallel_*_workers = N # capped at max_parallel_workers
>
> The last one turns a process-oriented description into a constraint, the
> latter seems to fit better in a config file.
>
> David J.
>
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Kline <kline(dot)christopher(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather
Date: 2024-02-15 17:31:33
Message-ID: 3270621.1708018293@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Christopher Kline <kline(dot)christopher(at)gmail(dot)com> writes:
> Thank you all for the clarification. I like David Johnston's suggestion of
> # capped at max_parallel_workers
> That clearly defines the constraint.

I was thinking perhaps "# limited by max_parallel_workers"
or something like that. "Capped at" isn't phraseology we
use elsewhere.

regards, tom lane


From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kline <kline(dot)christopher(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather
Date: 2024-02-15 19:41:59
Message-ID: CAKFQuwYVR+_T_1jXbgr09ELnHwVY+F2X2EWKduHLUeff9WmSGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 503 토토 결과 페치 실패

On Thu, Feb 15, 2024 at 10:31 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Christopher Kline <kline(dot)christopher(at)gmail(dot)com> writes:
> > Thank you all for the clarification. I like David Johnston's suggestion
> of
> > # capped at max_parallel_workers
> > That clearly defines the constraint.
>
> I was thinking perhaps "# limited by max_parallel_workers"
> or something like that. "Capped at" isn't phraseology we
> use elsewhere.
>
>
"limited by" is indeed better IMO as well.

David J.


From: Christopher Kline <kline(dot)christopher(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather
Date: 2024-02-15 20:29:06
Message-ID: CAArmHzRG4vi0rp8QetTWSeT0ZJj58qzn0jmvKXhZs_Y7c96bWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Agreed.

On Thu, Feb 15, 2024 at 2:42 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Thu, Feb 15, 2024 at 10:31 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> Christopher Kline <kline(dot)christopher(at)gmail(dot)com> writes:
>> > Thank you all for the clarification. I like David Johnston's suggestion
>> of
>> > # capped at max_parallel_workers
>> > That clearly defines the constraint.
>>
>> I was thinking perhaps "# limited by max_parallel_workers"
>> or something like that. "Capped at" isn't phraseology we
>> use elsewhere.
>>
>>
> "limited by" is indeed better IMO as well.
>
> David J.
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Kline <kline(dot)christopher(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather
Date: 2024-02-15 21:30:39
Message-ID: 3300728.1708032639@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Christopher Kline <kline(dot)christopher(at)gmail(dot)com> writes:
> On Thu, Feb 15, 2024 at 2:42 PM David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>> "limited by" is indeed better IMO as well.

> Agreed.

Sold, I'll make it so.

regards, tom lane