@@ -311,7 +311,7 @@ static PgStat_StatTabEntry *get_pgstat_tabentry_relid(Oid relid, bool isshared,
311
311
PgStat_StatDBEntry * shared ,
312
312
PgStat_StatDBEntry * dbentry );
313
313
static void autovac_report_activity (autovac_table * tab );
314
- static void avl_sighup_handler (SIGNAL_ARGS );
314
+ static void av_sighup_handler (SIGNAL_ARGS );
315
315
static void avl_sigusr2_handler (SIGNAL_ARGS );
316
316
static void avl_sigterm_handler (SIGNAL_ARGS );
317
317
static void autovac_refresh_stats (void );
@@ -419,7 +419,7 @@ AutoVacLauncherMain(int argc, char *argv[])
419
419
* backend, so we use the same signal handling. See equivalent code in
420
420
* tcop/postgres.c.
421
421
*/
422
- pqsignal (SIGHUP , avl_sighup_handler );
422
+ pqsignal (SIGHUP , av_sighup_handler );
423
423
pqsignal (SIGINT , StatementCancelHandler );
424
424
pqsignal (SIGTERM , avl_sigterm_handler );
425
425
@@ -1329,7 +1329,7 @@ AutoVacWorkerFailed(void)
1329
1329
1330
1330
/* SIGHUP: set flag to re-read config file at next convenient time */
1331
1331
static void
1332
- avl_sighup_handler (SIGNAL_ARGS )
1332
+ av_sighup_handler (SIGNAL_ARGS )
1333
1333
{
1334
1334
int save_errno = errno ;
1335
1335
@@ -1460,11 +1460,8 @@ AutoVacWorkerMain(int argc, char *argv[])
1460
1460
* Set up signal handlers. We operate on databases much like a regular
1461
1461
* backend, so we use the same signal handling. See equivalent code in
1462
1462
* tcop/postgres.c.
1463
- *
1464
- * Currently, we don't pay attention to postgresql.conf changes that
1465
- * happen during a single daemon iteration, so we can ignore SIGHUP.
1466
1463
*/
1467
- pqsignal (SIGHUP , SIG_IGN );
1464
+ pqsignal (SIGHUP , av_sighup_handler );
1468
1465
1469
1466
/*
1470
1467
* SIGINT is used to signal canceling the current table's vacuum; SIGTERM
@@ -2163,6 +2160,22 @@ do_autovacuum(void)
2163
2160
2164
2161
CHECK_FOR_INTERRUPTS ();
2165
2162
2163
+ /*
2164
+ * Check for config changes before processing each collected table.
2165
+ */
2166
+ if (got_SIGHUP )
2167
+ {
2168
+ got_SIGHUP = false;
2169
+ ProcessConfigFile (PGC_SIGHUP );
2170
+
2171
+ /*
2172
+ * You might be tempted to bail out if we see autovacuum is now
2173
+ * disabled. Must resist that temptation -- this might be a
2174
+ * for-wraparound emergency worker, in which case that would be
2175
+ * entirely inappropriate.
2176
+ */
2177
+ }
2178
+
2166
2179
/*
2167
2180
* hold schedule lock from here until we're sure that this table still
2168
2181
* needs vacuuming. We also need the AutovacuumLock to walk the
0 commit comments