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 <[email protected]>
Reviewed-by: Tristan Partin <[email protected]>
Reviewed-by: Kyotaro Horiguchi <[email protected]>
Discussion: 
https://postgr.es/m/CA+fm-RO_O7-XThg2qjj=ir35x9nofbzyu07gttqabm5t88q...@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(+)

Reply via email to