~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Bug#11763573 - 56299: MUTEX DEADLOCK WITH COM_BINLOG_DUMP, BINLOG PURGE, AND PROCESSLIST/KILL
 
3
#
 
4
source include/master-slave.inc;
 
5
source include/have_debug_sync.inc;
 
6
source include/have_binlog_format_row.inc;
 
7
source include/have_innodb.inc;
 
8
 
 
9
#
 
10
# Testing that execution of two concurrent INSERTing connections both
 
11
# triggering the binlog rotation is correct even though their execution
 
12
# is interleaved.
 
13
# The test makes the first connection to complete the rotation part
 
14
# and yields control to the second connection that rotates as well and 
 
15
# gets first on purging. And the fact of interleaving does not create
 
16
# any issue.
 
17
 
18
 
 
19
connection master;
 
20
source include/show_binary_logs.inc;
 
21
create table t1 (f text) engine=innodb;
 
22
SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated';
 
23
send insert into t1 set f=repeat('a', 4096);
 
24
 
 
25
connection master1;
 
26
 
 
27
let $wait_condition=
 
28
  SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
 
29
    WHERE STATE like "debug sync point: at_purge_logs_before_date%";
 
30
--source include/wait_condition.inc
 
31
 
 
32
--echo *** there must be two logs in the list ***
 
33
source include/show_binary_logs.inc;
 
34
 
 
35
insert into t1 set f=repeat('b', 4096);
 
36
 
 
37
--echo *** there must be three logs in the list ***
 
38
source include/show_binary_logs.inc;
 
39
 
 
40
SET DEBUG_SYNC = 'now SIGNAL rotated';
 
41
SET DEBUG_SYNC = 'RESET';
 
42
 
 
43
# the first connection finally completes its INSERT
 
44
connection master;
 
45
reap;
 
46
SET DEBUG_SYNC = 'RESET';
 
47
 
 
48
sync_slave_with_master;
 
49
 
 
50
 
 
51
#
 
52
# Testing the reported deadlock involving DUMP, KILL and INSERT threads
 
53
#
 
54
 
 
55
connection master;
 
56
SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated';
 
57
send insert into t1 set f=repeat('b', 4096);
 
58
 
 
59
connection master1;
 
60
 
 
61
# make sure INSERT reaches waiting point
 
62
let $wait_condition=
 
63
  SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
 
64
    WHERE STATE like "debug sync point: at_purge_logs_before_date%";
 
65
--source include/wait_condition.inc
 
66
 
 
67
# find and kill DUMP thread
 
68
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
 
69
--disable_query_log
 
70
eval kill query $_tid;
 
71
--enable_query_log
 
72
 
 
73
#
 
74
# Now the proof is that the new DUMP thread has executed
 
75
# a critical section of the deadlock without any regression and is UP
 
76
#
 
77
let $wait_condition=
 
78
  SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
 
79
    WHERE command = 'Binlog Dump' and STATE like "Master has sent all binlog to slave%";
 
80
--source include/wait_condition.inc
 
81
 
 
82
SET DEBUG_SYNC = 'now SIGNAL rotated';
 
83
SET DEBUG_SYNC = 'RESET';
 
84
 
 
85
connection master;
 
86
reap;
 
87
SET DEBUG_SYNC = 'RESET';
 
88
drop table t1;
 
89
 
 
90
sync_slave_with_master;
 
91
 
 
92
--source include/rpl_end.inc