Publish more openly the fact that autovacuum is working for wraparound

protection.

Simon Riggs
This commit is contained in:
Alvaro Herrera 2008-07-21 15:27:08 +00:00
parent df22da6173
commit df10fbab76

View File

@ -55,7 +55,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.71.2.4 2008/07/17 21:02:41 alvherre Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.71.2.5 2008/07/21 15:27:08 alvherre Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -291,7 +291,7 @@ static HeapTuple get_pg_autovacuum_tuple_relid(Relation avRel, Oid relid);
static PgStat_StatTabEntry *get_pgstat_tabentry_relid(Oid relid, bool isshared, static PgStat_StatTabEntry *get_pgstat_tabentry_relid(Oid relid, bool isshared,
PgStat_StatDBEntry *shared, PgStat_StatDBEntry *shared,
PgStat_StatDBEntry *dbentry); PgStat_StatDBEntry *dbentry);
static void autovac_report_activity(VacuumStmt *vacstmt, Oid relid); static void autovac_report_activity(VacuumStmt *vacstmt, Oid relid, bool for_wraparound);
static void avl_sighup_handler(SIGNAL_ARGS); static void avl_sighup_handler(SIGNAL_ARGS);
static void avl_sigusr1_handler(SIGNAL_ARGS); static void avl_sigusr1_handler(SIGNAL_ARGS);
static void avl_sigterm_handler(SIGNAL_ARGS); static void avl_sigterm_handler(SIGNAL_ARGS);
@ -2633,7 +2633,7 @@ autovacuum_do_vac_analyze(Oid relid, bool dovacuum, bool doanalyze,
MemoryContextSwitchTo(old_cxt); MemoryContextSwitchTo(old_cxt);
/* Let pgstat know what we're doing */ /* Let pgstat know what we're doing */
autovac_report_activity(&vacstmt, relid); autovac_report_activity(&vacstmt, relid, for_wraparound);
vacuum(&vacstmt, relids, bstrategy, for_wraparound, true); vacuum(&vacstmt, relids, bstrategy, for_wraparound, true);
} }
@ -2650,7 +2650,7 @@ autovacuum_do_vac_analyze(Oid relid, bool dovacuum, bool doanalyze,
* bother to report "<IDLE>" or some such. * bother to report "<IDLE>" or some such.
*/ */
static void static void
autovac_report_activity(VacuumStmt *vacstmt, Oid relid) autovac_report_activity(VacuumStmt *vacstmt, Oid relid, bool for_wraparound)
{ {
char *relname = get_rel_name(relid); char *relname = get_rel_name(relid);
char *nspname = get_namespace_name(get_rel_namespace(relid)); char *nspname = get_namespace_name(get_rel_namespace(relid));
@ -2661,8 +2661,9 @@ autovac_report_activity(VacuumStmt *vacstmt, Oid relid)
/* Report the command and possible options */ /* Report the command and possible options */
if (vacstmt->vacuum) if (vacstmt->vacuum)
snprintf(activity, MAX_AUTOVAC_ACTIV_LEN, snprintf(activity, MAX_AUTOVAC_ACTIV_LEN,
"autovacuum: VACUUM%s", "autovacuum: VACUUM%s%s",
vacstmt->analyze ? " ANALYZE" : ""); vacstmt->analyze ? " ANALYZE" : "",
for_wraparound ? " (to prevent wraparound)" : "");
else else
snprintf(activity, MAX_AUTOVAC_ACTIV_LEN, snprintf(activity, MAX_AUTOVAC_ACTIV_LEN,
"autovacuum: ANALYZE"); "autovacuum: ANALYZE");