mirror of
https://github.com/MariaDB/server.git
synced 2026-05-11 17:40:11 +02:00
After-merge fix for MDEV-11638
In commit 360a4a0372
some debug assertions were introduced to the page flushing code
in XtraDB. Add these assertions to InnoDB as well, and adjust
the InnoDB shutdown so that these assertions will not fail.
logs_empty_and_mark_files_at_shutdown(): Advance
srv_shutdown_state from the first phase SRV_SHUTDOWN_CLEANUP
only after no page-dirtying activity is possible
(well, except by srv_master_do_shutdown_tasks(), which will be
fixed separately in MDEV-12052).
rotate_thread_t::should_shutdown(): Already exit the key rotation
threads at the first phase of shutdown (SRV_SHUTDOWN_CLEANUP).
page_cleaner_sleep_if_needed(): Do not sleep during shutdown.
This change is originally from XtraDB.
This commit is contained in:
parent
65e1399e64
commit
a4d4a5fe82
5 changed files with 15 additions and 6 deletions
|
|
@ -150,6 +150,7 @@ buf_flush_insert_in_flush_rbt(
|
|||
buf_page_t* prev = NULL;
|
||||
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
|
||||
|
||||
ut_ad(srv_shutdown_state != SRV_SHUTDOWN_FLUSH_PHASE);
|
||||
ut_ad(buf_flush_list_mutex_own(buf_pool));
|
||||
|
||||
/* Insert this buffer into the rbt. */
|
||||
|
|
@ -359,6 +360,7 @@ buf_flush_insert_sorted_into_flush_list(
|
|||
buf_page_t* prev_b;
|
||||
buf_page_t* b;
|
||||
|
||||
ut_ad(srv_shutdown_state != SRV_SHUTDOWN_FLUSH_PHASE);
|
||||
ut_ad(!buf_pool_mutex_own(buf_pool));
|
||||
ut_ad(log_flush_order_mutex_own());
|
||||
ut_ad(mutex_own(&block->mutex));
|
||||
|
|
@ -678,6 +680,7 @@ buf_flush_write_complete(
|
|||
|
||||
flush_type = buf_page_get_flush_type(bpage);
|
||||
buf_pool->n_flush[flush_type]--;
|
||||
ut_ad(buf_pool->n_flush[flush_type] != ULINT_MAX);
|
||||
|
||||
ut_ad(buf_pool_mutex_own(buf_pool));
|
||||
|
||||
|
|
@ -1051,6 +1054,7 @@ buf_flush_page(
|
|||
}
|
||||
|
||||
++buf_pool->n_flush[flush_type];
|
||||
ut_ad(buf_pool->n_flush[flush_type] != 0);
|
||||
|
||||
mutex_exit(block_mutex);
|
||||
buf_pool_mutex_exit(buf_pool);
|
||||
|
|
@ -2273,6 +2277,11 @@ page_cleaner_sleep_if_needed(
|
|||
ulint next_loop_time) /*!< in: time when next loop iteration
|
||||
should start */
|
||||
{
|
||||
/* No sleep if we are cleaning the buffer pool during the shutdown
|
||||
with everything else finished */
|
||||
if (srv_shutdown_state == SRV_SHUTDOWN_FLUSH_PHASE)
|
||||
return;
|
||||
|
||||
ulint cur_time = ut_time_ms();
|
||||
|
||||
if (next_loop_time > cur_time) {
|
||||
|
|
|
|||
|
|
@ -1294,10 +1294,10 @@ struct rotate_thread_t {
|
|||
bool should_shutdown() const {
|
||||
switch (srv_shutdown_state) {
|
||||
case SRV_SHUTDOWN_NONE:
|
||||
case SRV_SHUTDOWN_CLEANUP:
|
||||
return thread_no >= srv_n_fil_crypt_threads;
|
||||
case SRV_SHUTDOWN_FLUSH_PHASE:
|
||||
case SRV_SHUTDOWN_CLEANUP:
|
||||
return true;
|
||||
case SRV_SHUTDOWN_FLUSH_PHASE:
|
||||
case SRV_SHUTDOWN_LAST_PHASE:
|
||||
case SRV_SHUTDOWN_EXIT_THREADS:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -3321,8 +3321,8 @@ wait_suspend_loop:
|
|||
|
||||
switch (srv_get_active_thread_type()) {
|
||||
case SRV_NONE:
|
||||
srv_shutdown_state = SRV_SHUTDOWN_FLUSH_PHASE;
|
||||
if (!srv_n_fil_crypt_threads_started) {
|
||||
srv_shutdown_state = SRV_SHUTDOWN_FLUSH_PHASE;
|
||||
break;
|
||||
}
|
||||
os_event_set(fil_crypt_threads_event);
|
||||
|
|
|
|||
|
|
@ -1294,10 +1294,10 @@ struct rotate_thread_t {
|
|||
bool should_shutdown() const {
|
||||
switch (srv_shutdown_state) {
|
||||
case SRV_SHUTDOWN_NONE:
|
||||
case SRV_SHUTDOWN_CLEANUP:
|
||||
return thread_no >= srv_n_fil_crypt_threads;
|
||||
case SRV_SHUTDOWN_FLUSH_PHASE:
|
||||
case SRV_SHUTDOWN_CLEANUP:
|
||||
return true;
|
||||
case SRV_SHUTDOWN_FLUSH_PHASE:
|
||||
case SRV_SHUTDOWN_LAST_PHASE:
|
||||
case SRV_SHUTDOWN_EXIT_THREADS:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -3639,8 +3639,8 @@ wait_suspend_loop:
|
|||
|
||||
switch (srv_get_active_thread_type()) {
|
||||
case SRV_NONE:
|
||||
srv_shutdown_state = SRV_SHUTDOWN_FLUSH_PHASE;
|
||||
if (!srv_n_fil_crypt_threads_started) {
|
||||
srv_shutdown_state = SRV_SHUTDOWN_FLUSH_PHASE;
|
||||
break;
|
||||
}
|
||||
os_event_set(fil_crypt_threads_event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue