1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

srv0srv.c:

In background loop run purge to completion before doing other background operations: it does not make sense to flush buffer pool pages if they are soon modified again by purge
trx0purge.c:
  Increase purge_sys->n_pages_handled for every undo log we purge, even if that log would be only a hundred bytes: that way we get the purge batches of 20 pages to set a fresh purge view (limit) more often, and we can reduce the number of old row versions purge has to look at when it decides if it can remove some delete-marked index record
This commit is contained in:
heikki@hundin.mysql.fi
2003-07-06 16:17:02 +03:00
parent fe025d40c4
commit e387dac042
2 changed files with 26 additions and 14 deletions

View File

@ -3009,10 +3009,29 @@ background_loop:
srv_main_thread_op_info = (char*)"purging";
if (srv_fast_shutdown && srv_shutdown_state > 0) {
n_pages_purged = 0;
} else {
n_pages_purged = trx_purge();
/* Run a full purge */
n_pages_purged = 1;
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";