Use MAX_PARALLEL_WORKER_LIMIT consistently in guc_tables.c

Started by Matthias van de Meentover 1 year ago3 messageshackers
Jump to latest
#1Matthias van de Meent
boekewurm+postgres@gmail.com

Hi,

Whilst doing some digging in parallel code, I noticed that
max_parallel_maintenance_workers is registered as guc with a manual
value of 1024, while max_parallel_workers_per_gather uses
MAX_PARALLEL_WORKER_LIMIT (also 1024). After some archeology, the
discrepancy seems to have existed ever since
max_parallel_maintenance_workers was originally introduced, as the
patch development that introduced the GUC that eventually got
committed predates the use of MAX_PARALLEL_WORKER_LIMIT in guc.c (now
guc_tables.c), and the change to the definition of sibling GUCs of
max_parallel_workers and max_parallel_workers_per_gather wasn't
noticed during that development.

PFA a trivial one-line patch that makes that a bit more consistent.

Kind regards,

Matthias van de Meent

Attachments:

v1-0001-Use-MAX_PARALLEL_WORKER_LIMIT-consistently.patchapplication/octet-stream; name=v1-0001-Use-MAX_PARALLEL_WORKER_LIMIT-consistently.patchDownload+1-2
#2Zhang Mingli
zmlpostgres@gmail.com
In reply to: Matthias van de Meent (#1)
Re: Use MAX_PARALLEL_WORKER_LIMIT consistently in guc_tables.c

Hi,

Zhang Mingli
www.hashdata.xyz
On Oct 9, 2024 at 20:35 +0800, Matthias van de Meent <boekewurm@gmail.com>, wrote:

Hi,

Whilst doing some digging in parallel code, I noticed that
max_parallel_maintenance_workers is registered as guc with a manual
value of 1024, while max_parallel_workers_per_gather uses
MAX_PARALLEL_WORKER_LIMIT (also 1024). After some archeology, the
discrepancy seems to have existed ever since
max_parallel_maintenance_workers was originally introduced, as the
patch development that introduced the GUC that eventually got
committed predates the use of MAX_PARALLEL_WORKER_LIMIT in guc.c (now
guc_tables.c), and the change to the definition of sibling GUCs of
max_parallel_workers and max_parallel_workers_per_gather wasn't
noticed during that development.

PFA a trivial one-line patch that makes that a bit more consistent.

LGTM.

#3Michael Paquier
michael@paquier.xyz
In reply to: Zhang Mingli (#2)
Re: Use MAX_PARALLEL_WORKER_LIMIT consistently in guc_tables.c

On Wed, Oct 09, 2024 at 10:28:05PM +0800, Zhang Mingli wrote:

On Oct 9, 2024 at 20:35 +0800, Matthias van de Meent <boekewurm@gmail.com>, wrote:

PFA a trivial one-line patch that makes that a bit more consistent.

LGTM.

Makes sense to me as well. Thanks for the patch.
--
Michael