Hi Jan! On Wed, Oct 12, 2016 at 7:31 AM, Jan Lindström <jan.lindstrom@mariadb.com> wrote:
revision-id: a3d469b991732dddfafe966011e996166cd98671 (mariadb-10.2.2-39-ga3d469b) parent(s): 6e46de4a674c55858ec5b2528dcebb69010b34d6 author: Jan Lindström committer: Jan Lindström timestamp: 2016-10-12 14:29:36 +0300 message:
MDEV-11035: Restore removed disallow-writes for Galera
Found actually only one missing condition.
The patch is unfortunately incomplete. There are a bunch of WAIT_ALLOW_WRITES' (when compared to 10.1) that are currently missing in 10.2. Also, there is a memory leak as InnoDB does not free this event on shutdown (srv_free()). You can use galera.galera_var_innodb_disallow_writes to verify the fix. Best, Nirbhay
--- storage/innobase/handler/ha_innodb.cc | 6 ++++-- storage/innobase/srv/srv0srv.cc | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 1e74154..dc7e6eb 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -23276,10 +23276,11 @@ innobase_disallow_writes_update( { *(my_bool*)var_ptr = *(my_bool*)save; ut_a(srv_allow_writes_event); - if (*(my_bool*)var_ptr) + if (*(my_bool*)var_ptr) { os_event_reset(srv_allow_writes_event); - else + } else { os_event_set(srv_allow_writes_event); + } }
static MYSQL_SYSVAR_BOOL(disallow_writes, innobase_disallow_writes, @@ -23287,6 +23288,7 @@ static MYSQL_SYSVAR_BOOL(disallow_writes, innobase_disallow_writes, "Tell InnoDB to stop any writes to disk", NULL, innobase_disallow_writes_update, FALSE); #endif /* WITH_INNODB_DISALLOW_WRITES */ + static MYSQL_SYSVAR_BOOL(random_read_ahead, srv_random_read_ahead, PLUGIN_VAR_NOCMDARG, "Whether to use read ahead for random access within an extent.", diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 49de954..a46f62f 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1969,9 +1969,7 @@ DECLARE_THREAD(srv_error_monitor_thread)( if (sync_array_print_long_waits(&waiter, &sema) && sema == old_sema && os_thread_eq(waiter, old_waiter)) { #if defined(WITH_WSREP) && defined(WITH_INNODB_DISALLOW_WRITES) - if (true) { - // JAN: TODO: MySQL 5.7 - //if (srv_allow_writes_event->is_set) { + if (os_event_is_set(srv_allow_writes_event)) { #endif /* WITH_WSREP */ fatal_cnt++; #if defined(WITH_WSREP) && defined(WITH_INNODB_DISALLOW_WRITES) _______________________________________________ commits mailing list commits@mariadb.org https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits