Commit ca8251c6 authored by heikki@hundin.mysql.fi's avatar heikki@hundin.mysql.fi

Merge heikki@build.mysql.com:/home/bk/mysql-4.0

into hundin.mysql.fi:/home/heikki/mysql-4.0
parents ee9237e0 e387dac0
...@@ -3009,10 +3009,29 @@ background_loop: ...@@ -3009,10 +3009,29 @@ background_loop:
srv_main_thread_op_info = (char*)"purging"; srv_main_thread_op_info = (char*)"purging";
if (srv_fast_shutdown && srv_shutdown_state > 0) { /* Run a full purge */
n_pages_purged = 0;
} else { n_pages_purged = 1;
n_pages_purged = trx_purge();
last_flush_time = time(NULL);
while (n_pages_purged) {
if (srv_fast_shutdown && srv_shutdown_state > 0) {
break;
}
srv_main_thread_op_info = (char*)"purging";
n_pages_purged = trx_purge();
current_time = time(NULL);
if (difftime(current_time, last_flush_time) > 1) {
srv_main_thread_op_info = (char*) "flushing log";
log_buffer_flush_to_disk();
last_flush_time = current_time;
}
} }
srv_main_thread_op_info = (char*)"reserving kernel mutex"; srv_main_thread_op_info = (char*)"reserving kernel mutex";
......
...@@ -593,7 +593,7 @@ trx_purge_rseg_get_next_history_log( ...@@ -593,7 +593,7 @@ trx_purge_rseg_get_next_history_log(
mutex_enter(&(rseg->mutex)); mutex_enter(&(rseg->mutex));
ut_ad(rseg->last_page_no != FIL_NULL); ut_a(rseg->last_page_no != FIL_NULL);
purge_sys->purge_trx_no = ut_dulint_add(rseg->last_trx_no, 1); purge_sys->purge_trx_no = ut_dulint_add(rseg->last_trx_no, 1);
purge_sys->purge_undo_no = ut_dulint_zero; purge_sys->purge_undo_no = ut_dulint_zero;
...@@ -606,16 +606,9 @@ trx_purge_rseg_get_next_history_log( ...@@ -606,16 +606,9 @@ trx_purge_rseg_get_next_history_log(
log_hdr = undo_page + rseg->last_offset; log_hdr = undo_page + rseg->last_offset;
seg_hdr = undo_page + TRX_UNDO_SEG_HDR; seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
if ((mach_read_from_2(log_hdr + TRX_UNDO_NEXT_LOG) == 0) /* Increase the purge page count by one for every handled log */
&& (mach_read_from_2(seg_hdr + TRX_UNDO_STATE)
== TRX_UNDO_TO_PURGE)) {
/* This is the last log header on this page and the log
segment cannot be reused: we may increment the number of
pages handled */
purge_sys->n_pages_handled++; purge_sys->n_pages_handled++;
}
prev_log_addr = trx_purge_get_log_from_hist( prev_log_addr = trx_purge_get_log_from_hist(
flst_get_prev_addr(log_hdr + TRX_UNDO_HISTORY_NODE, flst_get_prev_addr(log_hdr + TRX_UNDO_HISTORY_NODE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment