Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Patches > Is autovacuum d...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 3904 of 4098
Post > Topic >>

Is autovacuum doing a wraparound-avoiding VACUUM?

by simon@[EMAIL PROTECTED] (Simon Riggs) Jul 16, 2008 at 05:55 PM

--=-UXQtIRgEF4H/3cT+Hh8g
Content-Type: text/plain
Content-Transfer-Encoding: 7bit


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 im****tant.

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 Sup****t

--=-UXQtIRgEF4H/3cT+Hh8g
Content-Disposition: attachment; filename=wraparound_msg.v1.patch
Content-Type: text/x-patch; name=wraparound_msg.v1.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

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_re****t_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_re****t_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_re****t_activity(&vacstmt, relid);
  
  	vacuum(&vacstmt, relid, bstrategy, for_wraparound, true);
  }
--- 2626,2632 ----
  	vacstmt.va_cols = NIL;
  
  	/* Let pgstat know what we're doing */
! 	autovac_re****t_activity(&vacstmt, relid, for_wraparound);
  
  	vacuum(&vacstmt, relid, bstrategy, for_wraparound, true);
  }
***************
*** 2643,2649 ****
   * bother to re****t "<IDLE>" or some such.
   */
  static void
! autovac_re****t_activity(VacuumStmt *vacstmt, Oid relid)
  {
  	char	   *relname = get_rel_name(relid);
  	char	   *nspname = get_namespace_name(get_rel_namespace(relid));
--- 2643,2649 ----
   * bother to re****t "<IDLE>" or some such.
   */
  static void
! autovac_re****t_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];
  
  	/* Re****t 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];
  
  	/* Re****t 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" : "");

--=-UXQtIRgEF4H/3cT+Hh8g
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


-- 
Sent via pgsql-patches mailing list (pgsql-patches@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

--=-UXQtIRgEF4H/3cT+Hh8g--
 




 6 Posts in Topic:
Is autovacuum doing a wraparound-avoiding VACUUM?
simon@[EMAIL PROTECTED]   2008-07-16 17:55:39 
Re: Is autovacuum doing a wraparound-avoiding VACUUM?
alvherre@[EMAIL PROTECTED  2008-07-17 17:10:44 
Re: Is autovacuum doing a wraparound-avoiding VACUUM?
simon@[EMAIL PROTECTED]   2008-07-18 00:02:09 
Re: Is autovacuum doing a wraparound-avoiding VACUUM?
tgl@[EMAIL PROTECTED] (T  2008-07-18 01:44:38 
Re: Is autovacuum doing a wraparound-avoiding VACUUM?
simon@[EMAIL PROTECTED]   2008-07-19 09:04:08 
Re: Is autovacuum doing a wraparound-avoiding VACUUM?
alvherre@[EMAIL PROTECTED  2008-07-21 11:28:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 20:36:32 CDT 2008.