提交 5ce7f06d 编写于 作者: A Adam Berlin

Disable 'emergency mode' autovacuum worker.

In GPDB, we only want an autovacuum worker to start once we know
there is a database to vacuum.

When we changed the default value of the `autovacuum_start_daemon` from
`true` to `false` for GPDB, we made the behavior of the AutoVacuumLauncherMain()
be to immediately start an autovacuum worker from the launcher and exit,
which is called 'emergency mode'.  When the 'emergency mode' is running it is possible
to continuously start an autovacuum worker. Within the worker, the
PMSIGNAL_START_AUTOVAC_LAUNCHER signal is sent when a database is found that is old
enough to be vacuumed, but because we only autovacuum non-connectable
databases (template0) in GPDB and we do not have logic to filter out
connectable databases in the autovacuum worker.

This change allows the autovacuum launcher to do more up-front decision making
about whether it should start an autovacuum worker, including GPDB specific rules.
Co-authored-by: NAshwin Agrawal <aagrawal@pivotal.io>
上级 e9fe4224
......@@ -566,12 +566,26 @@ AutoVacLauncherMain(int argc, char *argv[])
SetConfigOption("default_transaction_isolation", "read committed",
PGC_SUSET, PGC_S_OVERRIDE);
/*
* In GPDB, we only want an autovacuum worker to start once we know
* there is a database to vacuum. Therefore, we never want emergency mode
* to start a worker immediately.
*
* Note: when the emergency mode is running it is possible to continuously
* start an autovacuum worker. Within the worker, the PMSIGNAL_START_AUTOVAC_LAUNCHER
* signal is sent when a database is found that is old enough to be vacuumed. If
* the database chosen is connectable, the launcher will never select it and the
* worker will continue to signal for a new launcher.
*/
#if 0
/* in emergency mode, just start a worker and go away */
if (!AutoVacuumingActive())
{
do_start_worker();
proc_exit(0); /* done */
}
#endif
AutoVacuumShmem->av_launcherpid = MyProcPid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册