[PATCH] Warn when io_min_workers exceeds io_max_workers - Mailing list pgsql-hackers

From Baji Shaik
Subject [PATCH] Warn when io_min_workers exceeds io_max_workers
Date
Msg-id CA+fm-RO_O7-XThg2qjj=ir35x9nOFbZYu07gttqAbM5T88QB4Q@mail.gmail.com
Whole thread
Responses Re: [PATCH] Warn when io_min_workers exceeds io_max_workers
List pgsql-hackers
Hi,

Setting io_min_workers to a value greater than io_max_workers is
silently accepted, but the minimum has no effect and the worker pool
never grows past io_max_workers. This can confuse users who expect at
least io_min_workers workers to always be running.

Compare with autovacuum which properly warns:

    WARNING:  "autovacuum_max_workers" (3) should be less than or equal
    to "autovacuum_worker_slots" (1)
    DETAIL:  The server will only start up to "autovacuum_worker_slots" (1)
    autovacuum workers at a given time.

The attached patch adds check_io_worker_gucs() in
storage/aio/method_worker.c that emits a WARNING similar to what
autovacuum does for autovacuum_worker_slots vs autovacuum_max_workers:

    WARNING:  "io_min_workers" (5) should be less than or equal to
              "io_max_workers" (3)
    DETAIL:  The I/O worker pool will not exceed "io_max_workers" (3)
             workers.

The check runs in IO worker 0 at startup and after each configuration
reload.

Thanks,
Baji Shaik
Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
Next
From: Andres Freund
Date:
Subject: Re: [RFC PATCH v0 0/7] Add EXPLAIN ANALYZE wait event reporting