From: Alvaro Herrera Date: Mon, 21 Jul 2008 15:27:08 +0000 (+0000) Subject: Publish more openly the fact that autovacuum is working for wraparound X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=ea96696eb0d6964e303f2fcc2c78b86e10a20061;p=users%2Fbernd%2Fpostgres.git Publish more openly the fact that autovacuum is working for wraparound protection. Simon Riggs --- diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index d8602c6641..d16aa6f758 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -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, PgStat_StatDBEntry *shared, 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_sigusr1_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); /* 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); } @@ -2650,7 +2650,7 @@ autovacuum_do_vac_analyze(Oid relid, bool dovacuum, bool doanalyze, * bother to report "" or some such. */ 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 *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 */ if (vacstmt->vacuum) snprintf(activity, MAX_AUTOVAC_ACTIV_LEN, - "autovacuum: VACUUM%s", - vacstmt->analyze ? " ANALYZE" : ""); + "autovacuum: VACUUM%s%s", + vacstmt->analyze ? " ANALYZE" : "", + for_wraparound ? " (to prevent wraparound)" : ""); else snprintf(activity, MAX_AUTOVAC_ACTIV_LEN, "autovacuum: ANALYZE");