pg.ddx.io pgsql-patches@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Simon Riggs <simon@2ndquadrant.com>
To: List pgsql-patches <pgsql-patches@postgresql.org>
Subject: Is autovacuum doing a wraparound-avoiding VACUUM?
Date: Wed, 16 Jul 2008 17:55:39 +0100
Message-ID: <1216227339.19656.364.camel@ebony.2ndQuadrant> (raw )
Is autovacuum doing a wraparound-avoiding VACUUM?
Currently, no easy way to tell.
Patch to change message of autovac in pg_stat_activity when we are
performing an anti-wraparound VACUUM.
We will then be able to explain why an autovacuum process doesn't get
cancelled, like we might otherwise hope it would be.
That way we can tell difference between hung and just important.
Perhaps message should say "non-automatically cancelled VACUUM
<tablename>", but that sounded more obscure than the phrase I selected.
Discuss...
--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support
Attachments:
wraparound_msg.v1.patch (text/x-patch, 2.8K) download
Index: src/backend/postmaster/autovacuum.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/src/backend/postmaster/autovacuum.c,v
retrieving revision 1.80
diff -c -r1.80 autovacuum.c
*** src/backend/postmaster/autovacuum.c 1 Jul 2008 02:09:34 -0000 1.80
--- src/backend/postmaster/autovacuum.c 16 Jul 2008 16:23:36 -0000
***************
*** 290,296 ****
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 avl_sighup_handler(SIGNAL_ARGS);
static void avl_sigusr1_handler(SIGNAL_ARGS);
static void avl_sigterm_handler(SIGNAL_ARGS);
--- 290,296 ----
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, bool for_wraparound);
static void avl_sighup_handler(SIGNAL_ARGS);
static void avl_sigusr1_handler(SIGNAL_ARGS);
static void avl_sigterm_handler(SIGNAL_ARGS);
***************
*** 2626,2632 ****
vacstmt.va_cols = NIL;
/* Let pgstat know what we're doing */
! autovac_report_activity(&vacstmt, relid);
vacuum(&vacstmt, relid, bstrategy, for_wraparound, true);
}
--- 2626,2632 ----
vacstmt.va_cols = NIL;
/* Let pgstat know what we're doing */
! autovac_report_activity(&vacstmt, relid, for_wraparound);
vacuum(&vacstmt, relid, bstrategy, for_wraparound, true);
}
***************
*** 2643,2649 ****
* bother to report "<IDLE>" or some such.
*/
static void
! autovac_report_activity(VacuumStmt *vacstmt, Oid relid)
{
char *relname = get_rel_name(relid);
char *nspname = get_namespace_name(get_rel_namespace(relid));
--- 2643,2649 ----
* bother to report "<IDLE>" or some such.
*/
static void
! 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));
***************
*** 2652,2658 ****
char activity[MAX_AUTOVAC_ACTIV_LEN];
/* Report the command and possible options */
! if (vacstmt->vacuum)
snprintf(activity, MAX_AUTOVAC_ACTIV_LEN,
"autovacuum: VACUUM%s",
vacstmt->analyze ? " ANALYZE" : "");
--- 2652,2661 ----
char activity[MAX_AUTOVAC_ACTIV_LEN];
/* Report the command and possible options */
! if (for_wraparound)
! snprintf(activity, MAX_AUTOVAC_ACTIV_LEN,
! "autovacuum: VACUUM to avoid wraparound of ");
! else if (vacstmt->vacuum)
snprintf(activity, MAX_AUTOVAC_ACTIV_LEN,
"autovacuum: VACUUM%s",
vacstmt->analyze ? " ANALYZE" : "");
view thread (6+ messages) latest in thread
Message-ID: <1216227339.19656.364.camel@ebony.2ndQuadrant>
Permalink: ../1216227339.19656.364.camel@ebony.2ndQuadrant/
Also on: postgresql.org/message-id/1216227339.19656.364.camel@ebony.2ndQuadrant
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-patches@postgresql.org
Cc: simon@2ndquadrant.com
Subject: Re: Is autovacuum doing a wraparound-avoiding VACUUM?
In-Reply-To: <1216227339.19656.364.camel@ebony.2ndQuadrant>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox