Hi, On 09/05/25 15:33, Daniil Davydov wrote: > Hi, > As I promised - meet parallel index autovacuum with bgworkers > (Parallel-index-autovacuum-with-bgworkers.patch). This is pretty > simple implementation : > 1) Added new table option `parallel_idx_autovac_enabled` that must be > set to `true` if user wants autovacuum to process table in parallel. > 2) Added new GUC variable `autovacuum_reserved_workers_num`. This is > number of parallel workers from bgworkers pool that can be used only > by autovacuum workers. The `autovacuum_reserved_workers_num` parameter > actually reserves a requested part of the processes, the total number > of which is equal to `max_worker_processes`. > 3) When an autovacuum worker decides to process some table in > parallel, it just sets `VacuumParams->nworkers` to appropriate value > (> 0) and then the code is executed as if it were a regular VACUUM > PARALLEL. > 4) I kept test/modules/autovacuum as sandbox where you can play with > parallel index autovacuum a bit. > > What do you think about this implementation? > I've reviewed the v1-0001 patch, the build on MacOS using meson+ninja is failing: ❯❯❯ ninja -C build install ninja: Entering directory `build' [1/126] Compiling C object src/backend/postgres_lib.a.p/utils_misc_guc_tables.c.o FAILED: src/backend/postgres_lib.a.p/utils_misc_guc_tables.c.o ../src/backend/utils/misc/guc_tables.c:3613:4: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion] 3613 | NULL, | ^~~~
It seems that the "autovacuum_reserved_workers_num" declaration on guc_tables.c has an extra gettext_noop() call? One other point is that as you've added TAP tests for the autovacuum I think you also need to create a meson.build file as you already create the Makefile. You also need to update the src/test/modules/meson.build and src/test/modules/Makefile to include the new test/modules/autovacuum path. -- Matheus Alcantara