Merge lp:~patrick-crews/drizzle/randgen_rpl_crash_tests into lp:~drizzle-trunk/drizzle/development

Proposed by Patrick Crews
Status: Merged
Approved by: Brian Aker
Approved revision: 2250
Merged at revision: 2252
Proposed branch: lp:~patrick-crews/drizzle/randgen_rpl_crash_tests
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 75 lines (+12/-2)
5 files modified
tests/lib/server_mgmt/server.py (+1/-0)
tests/lib/server_mgmt/server_management.py (+6/-0)
tests/lib/test_mgmt/test_execution.py (+3/-0)
tests/randgen_tests/innodb_trx_log/multi_thread1_crash_recover.cnf (+1/-1)
tests/randgen_tests/slave_plugin/multi_thread1_crash_recover.cnf (+1/-1)
To merge this branch: bzr merge lp:~patrick-crews/drizzle/randgen_rpl_crash_tests
Reviewer Review Type Date Requested Status
Drizzle Merge Team Pending
Review via email: mp+54774@code.launchpad.net

Description of the change

Added some code + randgen_test .cnf files so we now have crash tests for the innodb rpl log and the slave plugin (not yet hacked up for the file-based log)

slave_plugin.multi_thread1_crash_recover
innodb_trx_log.multi_thread1_crash_recover

We kill the server mid-randgen run (while multiple-threads are executing queries), we then restart the server and compare master and slave states (for slave plugin)

for the innodb log, we restart the master, then dump the sql from the log, populate a validation server, then compare master and slave contents.

These tests help us know that in the event of a crash the log will reflect the state of the data and the slave accurately reflects the master's state : )

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/lib/server_mgmt/server.py'
2--- tests/lib/server_mgmt/server.py 2011-03-17 06:31:49 +0000
3+++ tests/lib/server_mgmt/server.py 2011-03-24 20:20:59 +0000
4@@ -77,6 +77,7 @@
5 self.tried_start = 0
6 self.failed_test = 0 # was the last test a failure? our state is suspect
7 self.server_start_timeout = 60 * self.valgrind_time_buffer
8+ self.pid = None
9
10 def initialize_databases(self):
11 """ Call schemawriter to make db.opt files """
12
13=== modified file 'tests/lib/server_mgmt/server_management.py'
14--- tests/lib/server_mgmt/server_management.py 2011-03-24 00:34:19 +0000
15+++ tests/lib/server_mgmt/server_management.py 2011-03-24 20:20:59 +0000
16@@ -185,6 +185,7 @@
17 else:
18 # manual-gdb issue
19 server_retcode = 0
20+
21 timer = float(0)
22 timeout = float(server.server_start_timeout)
23
24@@ -206,6 +207,11 @@
25
26 if server_retcode == 0:
27 server.status = 1 # we are running
28+ if os.path.exists(server.pid_file):
29+ pid_file = open(server.pid_file,'r')
30+ pid = pid_file.readline().strip()
31+ pid_file.close()
32+ server.pid = pid
33
34 if server_retcode != 0 and not expect_fail and self.debug:
35 self.logging.debug("Server startup command: %s failed with error code %d" %( start_cmd
36
37=== modified file 'tests/lib/test_mgmt/test_execution.py'
38--- tests/lib/test_mgmt/test_execution.py 2011-03-17 06:31:49 +0000
39+++ tests/lib/test_mgmt/test_execution.py 2011-03-24 20:20:59 +0000
40@@ -140,6 +140,9 @@
41 variable_name = "%s_%s" %(self.name.upper(), server.name.upper())
42 variable_value = str(server.master_port)
43 extra_reqs[variable_name] = variable_value
44+ variable_name = variable_name + "_PID"
45+ variable_value = str(server.pid)
46+ extra_reqs[variable_name] = variable_value
47 self.working_environment.update(extra_reqs)
48 return
49
50
51=== modified file 'tests/randgen_tests/innodb_trx_log/multi_thread1_crash_recover.cnf'
52--- tests/randgen_tests/innodb_trx_log/multi_thread1_crash_recover.cnf 2011-03-14 22:22:08 +0000
53+++ tests/randgen_tests/innodb_trx_log/multi_thread1_crash_recover.cnf 2011-03-24 20:20:59 +0000
54@@ -2,7 +2,7 @@
55 comment = single threaded test
56
57 [test_command]
58-command = ./gentest.pl --gendata=conf/drizzle/translog_drizzle.zz --grammar=conf/drizzle/translog_concurrent1.yy --Reporter=DrizzleInnoTrxLogCrashRecovery --queries=250 --threads=3
59+command = ./gentest.pl --gendata=conf/drizzle/translog_drizzle.zz --grammar=conf/drizzle/translog_concurrent1.yy --Reporter=DrizzleInnoTrxLogCrashRecovery --queries=1000 --threads=3
60
61 [test_servers]
62 servers = [[--innodb.replication-log --plugin-add=shutdown_function ],[]]
63
64=== modified file 'tests/randgen_tests/slave_plugin/multi_thread1_crash_recover.cnf'
65--- tests/randgen_tests/slave_plugin/multi_thread1_crash_recover.cnf 2011-03-14 22:22:08 +0000
66+++ tests/randgen_tests/slave_plugin/multi_thread1_crash_recover.cnf 2011-03-24 20:20:59 +0000
67@@ -2,7 +2,7 @@
68 comment = single threaded test
69
70 [test_command]
71-command = ./gentest.pl --gendata=conf/drizzle/translog_drizzle.zz --grammar=conf/drizzle/translog_concurrent1.yy --Reporter=DrizzleSlavePluginCrashRecover --queries=100 --threads=3
72+command = ./gentest.pl --gendata=conf/drizzle/translog_drizzle.zz --grammar=conf/drizzle/translog_concurrent1.yy --Reporter=DrizzleSlavePluginCrashRecover --queries=1000 --threads=3
73
74 [test_servers]
75 servers = [[--innodb.replication-log --plugin-add=shutdown_function ],[--plugin-add=slave --slave.config-file=$MASTER_SERVER_SLAVE_CONFIG]]