Bug#15948818-SEMI-SYNC ENABLED MASTER CRASHES WHEN EVENT
SCHEDULER DROPS EVENTS Problem: On a semi sync enabled server (Master/Slave), if event scheduler drops an event after completion, server crashes. Analaysis: If an event is created with "ON COMPLETION NOT PRESERVE" clause, event scheduler deletes the event upon event completion(expiration) and the thread object will be destroyed. In the destructor of the thread object, mysys_var member is set to zero explicitly. Later from the same destructor call(same execution path), incase of semi sync enabled server, while cleanup is called, THD::mysys_var member is accessed by THD::enter_cond() function which causes server to crash. Fix: mysys_var should not be explicitly set to zero and also it is not required.
This commit is contained in:
parent
7c2a140911
commit
6f3e77e516
39
mysql-test/include/install_semisync.inc
Normal file
39
mysql-test/include/install_semisync.inc
Normal file
@ -0,0 +1,39 @@
|
||||
#
|
||||
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
--let $include_filename= install_semisync.inc
|
||||
--source include/begin_include_file.inc
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_semisync_plugin.inc
|
||||
|
||||
--connection master
|
||||
|
||||
--disable_query_log
|
||||
--let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1)
|
||||
if ($value == No such row)
|
||||
{
|
||||
SET sql_log_bin = 0;
|
||||
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
|
||||
SET GLOBAL rpl_semi_sync_master_enabled = 1;
|
||||
SET sql_log_bin = 1;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
--connection slave
|
||||
--source include/stop_slave_io.inc
|
||||
|
||||
--disable_query_log
|
||||
--let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1)
|
||||
if ($value == No such row)
|
||||
{
|
||||
SET sql_log_bin = 0;
|
||||
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
|
||||
SET GLOBAL rpl_semi_sync_slave_enabled = 1;
|
||||
SET sql_log_bin = 1;
|
||||
}
|
||||
START SLAVE IO_THREAD;
|
||||
--source include/wait_for_slave_io_to_start.inc
|
||||
--enable_query_log
|
||||
|
||||
--source include/end_include_file.inc
|
24
mysql-test/include/uninstall_semisync.inc
Normal file
24
mysql-test/include/uninstall_semisync.inc
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
--let $include_filename= uninstall_semisync.inc
|
||||
--source include/begin_include_file.inc
|
||||
|
||||
--disable_query_log
|
||||
--connection slave
|
||||
--source include/stop_slave_io.inc
|
||||
|
||||
# Uninstall rpl_semi_sync_slave first
|
||||
--disable_warnings
|
||||
UNINSTALL PLUGIN rpl_semi_sync_slave;
|
||||
|
||||
--connection master
|
||||
UNINSTALL PLUGIN rpl_semi_sync_master;
|
||||
--enable_warnings
|
||||
|
||||
--connection slave
|
||||
START SLAVE IO_THREAD;
|
||||
--source include/wait_for_slave_io_to_start.inc
|
||||
--enable_query_log
|
||||
|
||||
--source include/end_include_file.inc
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2000, 2013, Oracle and/or its affiliates. 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
|
||||
@ -1362,7 +1362,6 @@ THD::~THD()
|
||||
DBUG_ENTER("~THD()");
|
||||
/* Ensure that no one is using THD */
|
||||
mysql_mutex_lock(&LOCK_thd_data);
|
||||
mysys_var=0; // Safety (shouldn't be needed)
|
||||
mysql_mutex_unlock(&LOCK_thd_data);
|
||||
add_to_status(&global_status_var, &status_var);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user