diff options
author | unknown <heikki@hundin.mysql.fi> | 2003-05-04 15:14:33 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2003-05-04 15:14:33 +0300 |
commit | 87dc6aa669a3053255462d2534c5e740a70ced63 (patch) | |
tree | 8099bf93d112b46933f2465b075626c8c4394399 /innobase/srv | |
parent | 981a2b742bd0e17894c7c4670d697c571121051c (diff) | |
download | mariadb-git-87dc6aa669a3053255462d2534c5e740a70ced63.tar.gz |
srv0srv.c:
Do not let the main thread sleep the 1 second if we had to do a bug pool flush batch trying to establish srv_max_buf_pool_modified_pct
innobase/srv/srv0srv.c:
Do not let the main thread sleep the 1 second if we had to do a bug pool flush batch trying to establish srv_max_buf_pool_modified_pct
Diffstat (limited to 'innobase/srv')
-rw-r--r-- | innobase/srv/srv0srv.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 75742d8f670..147606ec17c 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -2760,6 +2760,7 @@ srv_master_thread( ulint n_ios_old; ulint n_ios_very_old; ulint n_pend_ios; + ibool skip_sleep = FALSE; ulint i; UT_NOT_USED(arg); @@ -2800,11 +2801,19 @@ loop: /* ---- We run the following loop approximately once per second when there is database activity */ + skip_sleep = FALSE; + for (i = 0; i < 10; i++) { n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read + buf_pool->n_pages_written; srv_main_thread_op_info = (char*)"sleeping"; - os_thread_sleep(1000000); + + if (!skip_sleep) { + + os_thread_sleep(1000000); + } + + skip_sleep = FALSE; /* ALTER TABLE in MySQL requires on Unix that the table handler can drop tables lazily after there no longer are SELECT @@ -2857,6 +2866,13 @@ loop: n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max); + + /* If we had to do the flush, it may have taken + even more than 1 second, and also, there may be more + to flush. Do not sleep 1 second during the next + iteration of this loop. */ + + skip_sleep = TRUE; } if (srv_activity_count == old_activity_count) { |