mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
Doc: add commentary about cowboy assignment of maintenance_work_mem.
Whilst working on commit 041e8b95b
I happened to notice that
parallel_vacuum_main() assigns directly to the maintenance_work_mem
GUC. This is definitely not per project conventions, so I tried to
fix it to use SetConfigOption(). But that fails with "parameter
cannot be set during a parallel operation". It doesn't seem worth
working on a cleaner answer, at least not till we have a few more
instances of similar problems. But add some commentary, just so
nobody gets the idea that this is an approved way to set a GUC.
This commit is contained in:
@@ -1032,6 +1032,13 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
|
|||||||
vac_open_indexes(rel, RowExclusiveLock, &nindexes, &indrels);
|
vac_open_indexes(rel, RowExclusiveLock, &nindexes, &indrels);
|
||||||
Assert(nindexes > 0);
|
Assert(nindexes > 0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Apply the desired value of maintenance_work_mem within this process.
|
||||||
|
* Really we should use SetConfigOption() to change a GUC, but since we're
|
||||||
|
* already in parallel mode guc.c would complain about that. Fortunately,
|
||||||
|
* by the same token guc.c will not let any user-defined code change it.
|
||||||
|
* So just avert your eyes while we do this:
|
||||||
|
*/
|
||||||
if (shared->maintenance_work_mem_worker > 0)
|
if (shared->maintenance_work_mem_worker > 0)
|
||||||
maintenance_work_mem = shared->maintenance_work_mem_worker;
|
maintenance_work_mem = shared->maintenance_work_mem_worker;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user