Slave_open_temp_tables fails to decrement on the slave w/ binlog off if master is killed

Bug #1567361 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
Medium
Laurynas Biveinis
5.7
Fix Released
Medium
Laurynas Biveinis

Bug Description

The fix [1] has been merged to PS 5.6 incorrectly: the part which decrements Slave_open_temp_tables on a slave with binlog off has been dropped. Diff of 5.6 trunk vs. PS 5.6 trunk in question is [2].

To repeat, add mysql-test/suite/rpl/t/rpl_create_drop_temp_table-slave.opt with "--skip-log-bin", and "--let $rpl_skip_reset_master_and_slave= 1" before --source include/master-slave.inc in the testcase script itself.

[1]

commit e1f5cb000cf42e337b7d9aa3e695b315950fcd03
Author: Venkatesh Duggirala <email address hidden>
Date: Tue Mar 18 18:40:47 2014 +0530

    Bug#18364070: Backporting Bug#18236612 to Mysql-5.6

    Problem: When Slave SQL thread detects that Master was restarted
    with the help of information sent by Master through 'FormatDescription'
    event, slave SQL drops all the opened temporary tables inorder to have
    proper cleanup. While slave SQL thread is dropping the temporary tables,
    it is not decrementing Slave_open_temp_tables count.

    Fix: Set slave_open_temp_tables=0 in close_temporary_tables(thd).

[2]

diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index be8ed86..70dd46f 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1572,8 +1581,7 @@ bool close_temporary_tables(THD *thd)
       close_temporary(t, 1, 1);
     }
     thd->temporary_tables= 0;
- if (thd->slave_thread)
- modify_slave_open_temp_tables(thd, -slave_open_temp_tables);
+ mysql_mutex_unlock(&thd->LOCK_temporary_tables);

     DBUG_RETURN(FALSE);
   }

tags: added: merge-regression
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1705

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.