From 0ebe127323fe5b0bbe2a1e6cc965e2874e4afd3c Mon Sep 17 00:00:00 2001 From: Sunny Bains Date: Wed, 28 Mar 2012 13:08:25 +1100 Subject: [PATCH] Bug# 13847885 - PURGING STALLS WHEN PURGE_SYS->N_PAGES_HANDLED OVERFLOWS Change the type of purge_sys_t::n_pages_handled and purge_sys_t::handle_limit to ulonglong from ulint. On a 32 bit system doing ~700 deletes per second the counters can overflow in ~3.5 months, if they are 32 bit. Approved by Jimmy Yang over IM. --- innobase/include/trx0purge.h | 4 ++-- innobase/trx/trx0purge.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/innobase/include/trx0purge.h b/innobase/include/trx0purge.h index 049c79aec9b..5b4e02a9b4d 100644 --- a/innobase/include/trx0purge.h +++ b/innobase/include/trx0purge.h @@ -120,9 +120,9 @@ struct trx_purge_struct{ read_view_t* view; /* The purge will not remove undo logs which are >= this view (purge view) */ mutex_t mutex; /* Mutex protecting the fields below */ - ulint n_pages_handled;/* Approximate number of undo log + ulonglong n_pages_handled;/* Approximate number of undo log pages processed in purge */ - ulint handle_limit; /* Target of how many pages to get + ulonglong handle_limit; /* Target of how many pages to get processed in the current purge */ /*------------------------------*/ /* The following two fields form the 'purge pointer' which advances diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c index 3df34111281..d5016f3fca4 100644 --- a/innobase/trx/trx0purge.c +++ b/innobase/trx/trx0purge.c @@ -1041,7 +1041,7 @@ trx_purge(void) { que_thr_t* thr; /* que_thr_t* thr2; */ - ulint old_pages_handled; + ulonglong old_pages_handled; mutex_enter(&(purge_sys->mutex)); @@ -1135,7 +1135,7 @@ trx_purge(void) (ulong) purge_sys->n_pages_handled); } - return(purge_sys->n_pages_handled - old_pages_handled); + return((ulint) (purge_sys->n_pages_handled - old_pages_handled)); } /**********************************************************************