Commit 3498a656 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14705: Follow-up fixes

buf_flush_remove(): Disable the output for now, because we
certainly do not want this after every page flush on shutdown.
It must be rate-limited somehow. There already is a timeout
extension for waiting the page cleaner to exit in
logs_empty_and_mark_files_at_shutdown().

log_write_up_to(): Use correct format.

srv_purge_should_exit(): Move the timeout extension to the
appropriate place, from one of the callers.
parent d61ed5dd
......@@ -530,13 +530,16 @@ buf_flush_remove(
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
ulint zip_size;
/* TODO Marko: "I think that it might be useful to have a global time base for the shutdown progress reporting and extending the timeout intervals." */
#if 0 // FIXME: Rate-limit the output. Move this to the page cleaner?
if (UNIV_UNLIKELY(srv_shutdown_state == SRV_SHUTDOWN_FLUSH_PHASE)) {
service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
"Flush and remove page with tablespace id %d"
", Poolid %d, flush list length %d",
bpage->space, buf_pool->instance_no, UT_LIST_GET_LEN(buf_pool->flush_list));
service_manager_extend_timeout(
INNODB_EXTEND_TIMEOUT_INTERVAL,
"Flush and remove page with tablespace id %u"
", Poolid " ULINTPF ", flush list length " ULINTPF,
bpage->space, buf_pool->instance_no,
UT_LIST_GET_LEN(buf_pool->flush_list));
}
#endif
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(mutex_own(buf_page_get_mutex(bpage)));
......
......@@ -2,7 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
Copyright (c) 2014, 2017, MariaDB Corporation.
Copyright (c) 2014, 2018, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
......@@ -1445,7 +1445,7 @@ log_write_up_to(
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
"log write up to: %llu", lsn);
"log write up to: " LSNPF, lsn);
}
loop:
......
......@@ -2542,6 +2542,9 @@ srv_purge_should_exit(ulint n_purged)
}
/* Slow shutdown was requested. */
if (n_purged) {
service_manager_extend_timeout(
INNODB_EXTEND_TIMEOUT_INTERVAL,
"InnoDB " ULINTPF " pages purged", n_purged);
/* The previous round still did some work. */
return(false);
}
......@@ -2732,11 +2735,6 @@ srv_do_purge(
(++count % TRX_SYS_N_RSEGS) == 0);
*n_total_purged += n_pages_purged;
if (n_pages_purged > 0) {
service_manager_extend_timeout(
INNODB_EXTEND_TIMEOUT_INTERVAL, "Innodb %d pages purged", n_pages_purged);
}
} while (!srv_purge_should_exit(n_pages_purged)
&& n_pages_purged > 0
&& purge_sys->state == PURGE_STATE_RUN);
......
......@@ -577,13 +577,16 @@ buf_flush_remove(
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
ulint zip_size;
/* TODO Marko: "I think that it might be useful to have a global time base for the shutdown progress reporting and extending the timeout intervals." */
#if 0 // FIXME: Rate-limit the output. Move this to the page cleaner?
if (UNIV_UNLIKELY(srv_shutdown_state == SRV_SHUTDOWN_FLUSH_PHASE)) {
service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
"Flush and remove page with tablespace id %d"
", Poolid %d, flush list length %d",
bpage->space, buf_pool->instance_no, UT_LIST_GET_LEN(buf_pool->flush_list));
service_manager_extend_timeout(
INNODB_EXTEND_TIMEOUT_INTERVAL,
"Flush and remove page with tablespace id %u"
", Poolid " ULINTPF ", flush list length " ULINTPF,
bpage->space, buf_pool->instance_no,
UT_LIST_GET_LEN(buf_pool->flush_list));
}
#endif
ut_ad(mutex_own(buf_page_get_mutex(bpage)));
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
......
......@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
Copyright (c) 2014, 2017, MariaDB Corporation.
Copyright (c) 2014, 2018, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
......@@ -1563,7 +1563,7 @@ log_write_up_to(
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
"log write up to: %llu", lsn);
"log write up to: " LSNPF, lsn);
}
loop:
......
......@@ -3236,6 +3236,9 @@ srv_purge_should_exit(ulint n_purged)
}
/* Slow shutdown was requested. */
if (n_purged) {
service_manager_extend_timeout(
INNODB_EXTEND_TIMEOUT_INTERVAL,
"InnoDB " ULINTPF " pages purged", n_purged);
/* The previous round still did some work. */
return(false);
}
......@@ -3440,11 +3443,6 @@ srv_do_purge(
(++count % TRX_SYS_N_RSEGS) == 0);
*n_total_purged += n_pages_purged;
if (n_pages_purged > 0) {
service_manager_extend_timeout(
INNODB_EXTEND_TIMEOUT_INTERVAL, "Innodb %d pages purged", n_pages_purged);
}
} while (!srv_purge_should_exit(n_pages_purged)
&& n_pages_purged > 0
&& purge_sys->state == PURGE_STATE_RUN);
......
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