mariadb/mysql-test/suite/binlog/r
Sven Sandberg de3776819c BUG#12574820: binlog.binlog_tmp_table timing out in daily and weekly trunk run
Problem: MYSQL_BIN_LOG::reset_logs acquires mutexes in wrong order.
The correct order is first LOCK_thread_count and then LOCK_log. This function
does it the other way around. This leads to deadlock when run in parallel
with a thread that takes the two locks in correct order. For example, a thread
that disconnects will take the locks in the correct order.
Fix: change order of the locks in MYSQL_BIN_LOG::reset_logs:
first LOCK_thread_count and then LOCK_log.


mysql-test/suite/binlog/r/binlog_reset_master.result:
  added result file
mysql-test/suite/binlog/t/binlog_reset_master.test:
  Added test case that demonstrates deadlock because of wrong mutex order.
  The deadlock is between two threads:
   - RESET MASTER acquires mutexes in wrong order.
   - client thread shutdown code acquires mutexes in right order.
  Actually, this test case does not produce deadlock in 5.1, probably
  the client thread shutdown code does not hold both mutexes at the same
  time. However, the bug existed in 5.1 (mutexes are taken in the wrong
  order) so we push the test case to 5.1 too, to prevent future
  regressions.
sql/log.cc:
  Change mutex acquisition to the correct order:
  first LOCK_thread_count, then LOCK_log.
sql/mysqld.cc:
  Add debug code to synchronize test case.
2011-05-26 12:50:43 +02:00
..
binlog_base64_flag.result
binlog_bug23533.result
binlog_bug36391.result
binlog_database.result
binlog_delete_and_flush_index.result
binlog_drop_if_exists.result
binlog_grant.result
binlog_incident.result
binlog_index.result
binlog_innodb.result
binlog_innodb_row.result
binlog_killed.result
binlog_killed_simulate.result
binlog_mix_innodb_stat.result
binlog_mixed_failure_mixing_engines.result
binlog_mixed_load_data.result
binlog_multi_engine.result
binlog_old_versions.result
binlog_query_filter_rules.result
binlog_reset_master.result
binlog_row_binlog.result
binlog_row_ctype_cp932.result
binlog_row_ctype_ucs.result
binlog_row_drop_tmp_tbl.result
binlog_row_failure_mixing_engines.result
binlog_row_innodb_stat.result
binlog_row_insert_select.result
binlog_row_mix_innodb_myisam.result
binlog_row_mysqlbinlog_db_filter.result
binlog_row_mysqlbinlog_verbose.result
binlog_server_id.result
binlog_sf.result
binlog_sql_mode.result
binlog_start_comment.result
binlog_statement_insert_delayed.result
binlog_stm_binlog.result
binlog_stm_blackhole.result
binlog_stm_ctype_cp932.result
binlog_stm_ctype_ucs.result
binlog_stm_do_db.result
binlog_stm_drop_tmp_tbl.result
binlog_stm_innodb_stat.result
binlog_stm_insert_select.result
binlog_stm_mix_innodb_myisam.result
binlog_stm_ps.result
binlog_stm_row.result
binlog_stm_unsafe_warning.result
binlog_tmp_table.result
binlog_truncate_innodb.result
binlog_truncate_myisam.result
binlog_unsafe.result
binlog_write_error.result