summaryrefslogtreecommitdiff
path: root/storage/innobase/ut
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-02-17 10:32:21 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-02-20 12:32:43 +0200
commita13a636c74d9778ec0430ec963dcfd1614f7c81e (patch)
tree7a31a9fb0fd7dda11257aec628014a8b36f05b98 /storage/innobase/ut
parentcc4b2b185d73963ad55730f8e3e205530a491d30 (diff)
downloadmariadb-git-a13a636c74d9778ec0430ec963dcfd1614f7c81e.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. log_write_flush_to_disk_low(): Invoke log_mutex_enter() at the end, to avoid race conditions when changing the system state. (No potential race condition existed before MySQL 5.7.)
Diffstat (limited to 'storage/innobase/ut')
-rw-r--r--storage/innobase/ut/ut0wqueue.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/innobase/ut/ut0wqueue.cc b/storage/innobase/ut/ut0wqueue.cc
index cee30925375..ccd5c10555c 100644
--- a/storage/innobase/ut/ut0wqueue.cc
+++ b/storage/innobase/ut/ut0wqueue.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2006, 2015, 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
@@ -31,7 +32,9 @@ Created 4/26/2006 Osku Salerma
struct ib_wqueue_t {
ib_mutex_t mutex; /*!< mutex protecting everything */
ib_list_t* items; /*!< work item list */
- os_event_t event; /*!< event we use to signal additions to list */
+ os_event_t event; /*!< event we use to signal additions to list;
+ os_event_set() and os_event_reset() are
+ protected by ib_wqueue_t::mutex */
};
/****************************************************************//**