On Fri, Apr 12, 2024 at 10:17:44PM +0000, Imseih (AWS), Sami wrote: >>> Hm. Maybe the autovacuum launcher could do that. > > Would it be better to use a GUC check_hook that compares the > new value with the max allowed values and emits a WARNING ? > > autovacuum_max_workers already has a check_autovacuum_max_workers > check_hook, which can be repurposed for this. > > In the POC patch, this check_hook is kept as-is, which will no longer make > sense.
IIRC using GUC hooks to handle dependencies like this is generally frowned upon because it tends to not work very well [0]. We could probably get it to work for this particular case, but IMHO we should still try to avoid this approach. I didn't find any similar warnings for other GUCs like max_parallel_workers_per_gather, so it might not be crucial to emit a WARNING here. [0] https://postgr.es/m/27574.1581015893%40sss.pgh.pa.us -- Nathan Bossart Amazon Web Services: https://aws.amazon.com