81
81
"Dies if no other nodes are found"
85
($output, $exit_status) = full_output(
86
sub { pt_table_checksum::main(@args, '--recursion-method', 'none') },
91
$output =~ qr/WARNING/i && !$exit_status,
92
"Warns but doesn't die if --recursion-method=none - issue #1373937"
85
96
["using recusion-method=dsn", '--recursion-method', "dsn=$node1_dsn,D=dsns,t=dsns"],
86
97
["using recursion-method=cluster", '--recursion-method', 'cluster']
144
155
"Node3 not changed"
148
["using recusion-method=dsn", '--recursion-method', "dsn=$node1_dsn,D=dsns,t=dsns"],
149
["using recursion-method=cluster", '--recursion-method', 'cluster']
152
my $test = shift @$args;
155
sub { pt_table_checksum::main(@args,
162
PerconaTest::count_checksum_results($output, 'errors'),
164
"1 diff: no errors ($test)"
168
PerconaTest::count_checksum_results($output, 'skipped'),
170
"1 diff: no skips ($test)"
174
PerconaTest::count_checksum_results($output, 'diffs'),
176
"1 diff: 1 diff ($test)"
179
# 11-17T13:02:54 0 1 26 1 0 0.021 test.t
191
"1 diff: it's in test.t ($test)"
158
sub test_recursion_methods {
159
my $same_ids = shift;
161
my ($orig_id_1, $orig_id_2, $orig_id_3);
164
# save original values
165
my $sql = 'SELECT @@server_id';
166
($orig_id_1) = $node1->selectrow_array($sql);
167
($orig_id_2) = $node2->selectrow_array($sql);
168
($orig_id_3) = $node3->selectrow_array($sql);
169
# set server_id value to 1 on all nodes
170
$sql = 'SET GLOBAL server_id = 1';
177
["using recusion-method=dsn", '--recursion-method', "dsn=$node1_dsn,D=dsns,t=dsns"],
178
["using recursion-method=cluster", '--recursion-method', 'cluster']
181
my $test = shift @$args;
182
$test = $same_ids ? $test.' - Nodes with different ids' : $test.' - Nodes with same ids';
185
sub { pt_table_checksum::main(@args,
192
PerconaTest::count_checksum_results($output, 'errors'),
194
"1 diff: no errors ($test)"
198
PerconaTest::count_checksum_results($output, 'skipped'),
200
"1 diff: no skips ($test)"
204
PerconaTest::count_checksum_results($output, 'diffs'),
206
"1 diff: 1 diff ($test)"
209
# 11-17T13:02:54 0 1 26 1 0 0.021 test.t
221
"1 diff: it's in test.t ($test)"
226
# reset server_id's to original values
227
$node1->do("SET GLOBAL server_id = $orig_id_1");
228
$node2->do("SET GLOBAL server_id = $orig_id_2");
229
$node3->do("SET GLOBAL server_id = $orig_id_3");
234
# test recursion methods
235
test_recursion_methods(0);
237
# test recursion methods when all nodes have the same id
238
test_recursion_methods(1);
195
241
# #############################################################################
196
242
# cluster, node1 -> slave, run on node1
197
243
# #############################################################################