Debian Codegraph @

mysql-test/suite/clone/t/remote_dml_recovery.test

raw
1 # Test recovery crash for remote clone with concurrent DML
2
3 --source include/not_valgrind.inc
4 --source include/linux.inc
5 --source include/have_mysqld_safe.inc
6 --source include/have_debug.inc
7
8 --let $HOST = 127.0.0.1
9 --let $PORT =`select @@port`
10 --let $USER = root
11
12 --let clone_remote_replace = 1
13 --let inst_monitor = 1
14 --let clone_inst_number = 2
15
16 --disable_query_log
17 call mtr.add_suppression("\\[Warning\\] .*MY-\\d+.* Clone removing all user data for provisioning: .*");
18 call mtr.add_suppression("\\[ERROR\\] .*MY-\\d+.*clone_check_recovery_crashpoint.*");
19 --enable_query_log
20
21 --source ../include/clone_connection_begin.inc
22 --source include/count_sessions.inc
23 --let $CLONE_DATADIR = $MYSQL_TMP_DIR/data_new
24
25 --echo # Install clone plugin
26 --replace_result $CLONE_PLUGIN CLONE_PLUGIN
27 --eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'
28
29 --echo ## Create test schema
30 --source ../include/create_schema.inc
31
32 --echo # Insert rows
33 --eval call execute_dml(0, 0, 100, 100, 10, 0)
34
35 --echo # Check base rows
36 SHOW CREATE TABLE t1;
37 SELECT count(*) from t1;
38 SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;
39 SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;
40
41 SHOW CREATE TABLE t2;
42 SELECT count(*) from t2;
43 SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;
44 SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;
45
46 --echo # In connection con1 - Running Insert Random [100 - 200 Key range]
47 connect (con1,localhost,root,,);
48 --send call execute_dml(0, 100, 100, 100, 20, 1)
49
50 --echo # In connection con2 - Running Update Random [0 - 25 Key Range]
51 connect (con2,localhost,root,,);
52 --send call execute_dml(1, 0, 25, 100, 20, 1)
53
54 --echo # In connection default - Cloning database
55 --connection clone_conn_1
56 --let clone_recovery_error = 1
57 SET global debug="+d,clone_recovery_crash_point";
58 --source ../include/clone_command.inc
59 SET global debug="-d,clone_recovery_crash_point";
60 --let clone_recovery_error = 0
61 --echo # In connection default - Finished Cloning
62
63 --echo # In connection con1 - Waiting
64 connection con1;
65 --reap
66
67 --echo # In connection con2 - Waiting
68 connection con2;
69 --reap
70
71 --echo # In connection default
72 connection default;
73
74 disconnect con1;
75 disconnect con2;
76
77 --source include/wait_until_count_sessions.inc
78
79 --connection clone_conn_1
80
81 # Check table in cloned database
82 SHOW SCHEMAS;
83
84 --connection default
85 --source ../include/drop_schema.inc
86
87 --echo # Cleanup
88 --connection clone_conn_1
89 --source ../include/clone_command.inc
90
91 --source ../include/clone_connection_end.inc
92
93 UNINSTALL PLUGIN clone;