summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-07-21 13:17:53 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-07-22 18:02:52 +0530
commit3a8943ae7317ad48127387855ab5258a9bb2147a (patch)
tree4de988be770cb17156cbdd958123a3852b27c635
parent2a3bc0b9cdd7f4bd3ed57ddec6cc1fd7ca5b35d9 (diff)
downloadmariadb-git-3a8943ae7317ad48127387855ab5258a9bb2147a.tar.gz
MDEV-17481 mariadb service won't shutdown when it's running and the OS datetime updated backwards
__pthread_cond_timedwait() in page cleaner hangs if os time moved backwards.Workaround could be waking up the page cleaner thread in logs_empty_and_mark_files_at_shutdown(). But there is possibility that server could hang when server is running. So InnoDB should wake up page cleaner thread periodically in srv_master_do_idle_tasks().
-rw-r--r--storage/innobase/log/log0log.cc3
-rw-r--r--storage/innobase/srv/srv0srv.cc4
2 files changed, 7 insertions, 0 deletions
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index ea657e49d07..972bbe7c6c0 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -1936,6 +1936,9 @@ wait_suspend_loop:
"Waiting for page cleaner");
ib::info() << "Waiting for page_cleaner to "
"finish flushing of buffer pool";
+ /* This is a workaround to avoid the InnoDB hang
+ when OS datetime changed backwards */
+ os_event_set(buf_flush_event);
count = 0;
}
}
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 6388f84cdea..f1216dcd51e 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -2365,6 +2365,10 @@ srv_master_do_idle_tasks(void)
log_checkpoint(true);
MONITOR_INC_TIME_IN_MICRO_SECS(MONITOR_SRV_CHECKPOINT_MICROSECOND,
counter_time);
+
+ /* This is a workaround to avoid the InnoDB hang when OS datetime
+ changed backwards.*/
+ os_event_set(buf_flush_event);
}
/** Perform shutdown tasks.