pgsql: Emit a warning when io_min_workers exceeds io_max_workers

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Emit a warning when io_min_workers exceeds io_max_workers
Date: 2026-07-06 02:38:34
Message-ID: E1wgZEA-001WjL-1g@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Emit a warning when io_min_workers exceeds io_max_workers

When io_min_workers is set strictly higher than io_max_workers, the
minimum has no effect since the pool will never grow past
io_max_workers. Previously this was silently accepted, which could
be confusing for users expecting at least io_min_workers workers to
always be running.

In order to avoid noise in the server logs, the following restrictions
are in place:
- The only process printing the WARNING is the IO worker with ID 0, on
startup and reload, which is we know the only process always running
when using IO workers.
- At reload, the message shows only if one of the bounds has changed.

Note that this commit reuses a log message updated by 7905416eef9b.

Author: Baji Shaik <baji(dot)pgdev(at)gmail(dot)com>
Reviewed-by: Tristan Partin <tristan(at)partin(dot)io>
Reviewed-by: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Discussion: https://postgr.es/m/CA+fm-RO_O7-XThg2qjj=ir35x9nOFbZYu07gttqAbM5T88QB4Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9d1188f29865e66c4196578501e74e8c815fba8d

Modified Files
--------------
src/backend/storage/aio/method_worker.c | 34 +++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Richard Guo 2026-07-06 07:16:27 pgsql: Fix qual pushdown past grouping with mismatched equivalence
Previous Message Michael Paquier 2026-07-06 01:50:04 pgsql: Improve checks and error messages of pgstat_register_kind()