diff options
author | Mikael Ronstrom <mikael@dator8> | 2011-03-04 12:35:24 +0100 |
---|---|---|
committer | Mikael Ronstrom <mikael@dator8> | 2011-03-04 12:35:24 +0100 |
commit | 0fc7078e53eb2b34503ddd2408844c2fa06d393f (patch) | |
tree | bccbd7ab21bb499f9f924e6f90e9303f3018d1ae /storage/innobase/srv/srv0srv.c | |
parent | 23296fdc18e864b1b016b4c6a47723b26480f9c6 (diff) | |
parent | a4711099716c53490a69c3c17a8b61a4a3282b19 (diff) | |
download | mariadb-git-0fc7078e53eb2b34503ddd2408844c2fa06d393f.tar.gz |
merge
Diffstat (limited to 'storage/innobase/srv/srv0srv.c')
-rw-r--r-- | storage/innobase/srv/srv0srv.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index dcfd5463fbc..3e10aa03096 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved. +Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. @@ -269,9 +269,12 @@ UNIV_INTERN ulong srv_max_buf_pool_modified_pct = 75; /* the number of purge threads to use from the worker pool (currently 0 or 1).*/ UNIV_INTERN ulong srv_n_purge_threads = 0; -/* the number of records to purge in one batch */ +/* the number of pages to purge in one batch */ UNIV_INTERN ulong srv_purge_batch_size = 20; +/* the number of rollback segments to use */ +UNIV_INTERN ulong srv_rollback_segments = TRX_SYS_N_RSEGS; + /* variable counts amount of data read in total (in bytes) */ UNIV_INTERN ulint srv_data_read = 0; @@ -3096,6 +3099,7 @@ srv_purge_thread( required by os_thread_create */ { srv_slot_t* slot; + ulint retries = 0; ulint slot_no = ULINT_UNDEFINED; ulint n_total_purged = ULINT_UNDEFINED; @@ -3122,7 +3126,7 @@ srv_purge_thread( while (srv_shutdown_state != SRV_SHUTDOWN_EXIT_THREADS) { - ulint n_pages_purged; + ulint n_pages_purged = 0; /* If there are very few records to purge or the last purge didn't purge any records then wait for activity. @@ -3130,7 +3134,8 @@ srv_purge_thread( because in the worst case we will end up waiting for the next purge event. */ if (trx_sys->rseg_history_len < srv_purge_batch_size - || n_total_purged == 0) { + || (n_total_purged == 0 + && retries >= TRX_SYS_N_RSEGS)) { os_event_t event; @@ -3141,6 +3146,8 @@ srv_purge_thread( mutex_exit(&kernel_mutex); os_event_wait(event); + + retries = 0; } /* Check for shutdown and whether we should do purge at all. */ @@ -3151,7 +3158,12 @@ srv_purge_thread( break; } - n_total_purged = 0; + if (n_total_purged == 0 && retries <= TRX_SYS_N_RSEGS) { + ++retries; + } else if (n_total_purged > 0) { + retries = 0; + n_total_purged = 0; + } /* Purge until there are no more records to purge and there is no change in configuration or server state. */ |