summaryrefslogtreecommitdiff
path: root/storage/xtradb/buf/buf0dump.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-02-16 19:40:03 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-02-20 12:20:52 +0200
commit13493078e9aea37f6714b3921921aa10864c8b30 (patch)
tree904582d100122e966de83891ce372908d128294d /storage/xtradb/buf/buf0dump.cc
parent72994d6442ec6156ccfefb260771537a8b6d80b9 (diff)
downloadmariadb-git-13493078e9aea37f6714b3921921aa10864c8b30.tar.gz
MDEV-11802 innodb.innodb_bug14676111 fails
The function trx_purge_stop() was calling os_event_reset(purge_sys->event) before calling rw_lock_x_lock(&purge_sys->latch). The os_event_set() call in srv_purge_coordinator_suspend() is protected by that X-latch. It would seem a good idea to consistently protect both os_event_set() and os_event_reset() calls with a common mutex or rw-lock in those cases where os_event_set() and os_event_reset() are used like condition variables, tied to changes of shared state. For each os_event_t, we try to document the mutex or rw-lock that is being used. For some events, frequent calls to os_event_set() seem to try to avoid hangs. Some events are never waited for infinitely, only timed waits, and os_event_set() is used for early termination of these waits. os_aio_simulated_put_read_threads_to_sleep(): Define as a null macro on other systems than Windows. TODO: remove this altogether and disable innodb_use_native_aio on Windows. os_aio_segment_wait_events[]: Initialize only if innodb_use_native_aio=0.
Diffstat (limited to 'storage/xtradb/buf/buf0dump.cc')
-rw-r--r--storage/xtradb/buf/buf0dump.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/storage/xtradb/buf/buf0dump.cc b/storage/xtradb/buf/buf0dump.cc
index cae6099f03e..df62c945288 100644
--- a/storage/xtradb/buf/buf0dump.cc
+++ b/storage/xtradb/buf/buf0dump.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -52,8 +53,8 @@ enum status_severity {
/* Flags that tell the buffer pool dump/load thread which action should it
take after being waked up. */
-static ibool buf_dump_should_start = FALSE;
-static ibool buf_load_should_start = FALSE;
+static volatile bool buf_dump_should_start;
+static volatile bool buf_load_should_start;
static ibool buf_load_abort_flag = FALSE;
@@ -78,7 +79,7 @@ void
buf_dump_start()
/*============*/
{
- buf_dump_should_start = TRUE;
+ buf_dump_should_start = true;
os_event_set(srv_buf_dump_event);
}
@@ -92,7 +93,7 @@ void
buf_load_start()
/*============*/
{
- buf_load_should_start = TRUE;
+ buf_load_should_start = true;
os_event_set(srv_buf_dump_event);
}
@@ -695,15 +696,18 @@ DECLARE_THREAD(buf_dump_thread)(
os_event_wait(srv_buf_dump_event);
if (buf_dump_should_start) {
- buf_dump_should_start = FALSE;
+ buf_dump_should_start = false;
buf_dump(TRUE /* quit on shutdown */);
}
if (buf_load_should_start) {
- buf_load_should_start = FALSE;
+ buf_load_should_start = false;
buf_load();
}
+ if (buf_dump_should_start || buf_load_should_start) {
+ continue;
+ }
os_event_reset(srv_buf_dump_event);
}