|
| 1 | +# This file is used by extra/rpl_tests/rpl_check_ps_connection_applier_status_tables.inc |
| 2 | +# |
| 3 | +# Using debug points to track the execution flow of a transaction in the slave, |
| 4 | +# this file asserts that the new columns in the queried tables have the |
| 5 | +# expected values. |
| 6 | +# |
| 7 | +# params: $current_gtid the gtid that is currently being processed |
| 8 | +# $last_gtid the gtid that was last processed |
| 9 | +# $debug_sync_[1-4] the names of the four debug sync points |
| 10 | +# $is_first_check 1 if is first table to be queried |
| 11 | +# $table table to be queried |
| 12 | +# $now_handling_gtid_column name of the column for now handling GTID |
| 13 | +# $now_handling_OCT_column name of the column for now handling OCT |
| 14 | +# $now_handling_ICT_column name of the column for now handling ICT |
| 15 | +# $now_handling_start_column name of the column for now handling start |
| 16 | +# $last_handled_gtid_column name of column for last handled GTID |
| 17 | +# $last_handled_OCT_column name of column for last handled OCT |
| 18 | +# $last_handled_ICT_column name of column for last handled ICT |
| 19 | +# $last_handled_start_column name of column for last handled start |
| 20 | +# $last_handled_end_column name of column for last handled end |
| 21 | +# $now_handling_action trx action this table refers to |
| 22 | +# $last_handled_action trx action this table refers to |
| 23 | +# $is_first_stmt 1 is this is the first statement of the |
| 24 | +# test |
| 25 | + |
| 26 | +eval SET debug_sync= $debug_sync_1; |
| 27 | +if ($is_first_check) |
| 28 | +{ |
| 29 | + --source include/remove_debug_point.inc |
| 30 | +} |
| 31 | + |
| 32 | +--let $now_handling_before_gtid= query_get_value(SELECT $now_handling_gtid_column FROM $table, $now_handling_gtid_column, 1) |
| 33 | +--let $now_handling_before_OCT= query_get_value(SELECT $now_handling_OCT_column FROM $table, $now_handling_OCT_column, 1) |
| 34 | +--let $now_handling_before_ICT= query_get_value(SELECT $now_handling_ICT_column FROM $table, $now_handling_ICT_column, 1) |
| 35 | +--let $now_handling_before_start= query_get_value(SELECT $now_handling_start_column FROM $table, $now_handling_start_column, 1) |
| 36 | +--let $last_handled_before_gtid= query_get_value(SELECT $last_handled_gtid_column FROM $table, $last_handled_gtid_column, 1) |
| 37 | +eval SET debug_sync= $debug_sync_2; |
| 38 | + |
| 39 | +eval SET debug_sync= $debug_sync_3; |
| 40 | +--let $now_handling_after_gtid= query_get_value(SELECT $now_handling_gtid_column FROM $table, $now_handling_gtid_column, 1) |
| 41 | +--let $now_handling_after_OCT= query_get_value(SELECT $now_handling_OCT_column FROM $table, $now_handling_OCT_column, 1) |
| 42 | +--let $now_handling_after_ICT= query_get_value(SELECT $now_handling_ICT_column FROM $table, $now_handling_ICT_column, 1) |
| 43 | +--let $now_handling_after_start= query_get_value(SELECT $now_handling_start_column FROM $table, $now_handling_start_column, 1) |
| 44 | +--let $last_handled_after_gtid= query_get_value(SELECT $last_handled_gtid_column FROM $table, $last_handled_gtid_column, 1) |
| 45 | +--let $last_handled_after_OCT= query_get_value(SELECT $last_handled_OCT_column FROM $table, $last_handled_OCT_column, 1) |
| 46 | +--let $last_handled_after_ICT= query_get_value(SELECT $last_handled_ICT_column FROM $table, $last_handled_ICT_column, 1) |
| 47 | +--let $last_handled_after_start= query_get_value(SELECT $last_handled_start_column FROM $table, $last_handled_start_column, 1) |
| 48 | +--let $last_handled_after_end= query_get_value(SELECT $last_handled_end_column FROM $table, $last_handled_end_column, 1) |
| 49 | +eval SET debug_sync= $debug_sync_4; |
| 50 | + |
| 51 | +--let $assert_text= Assert that the currently $now_handling_action gtid is equal to current_gtid |
| 52 | +--let $assert_cond= "$now_handling_before_gtid" = "$current_gtid" |
| 53 | +--source include/assert.inc |
| 54 | + |
| 55 | +--let $assert_text= Assert that the last $last_handled_action gtid is equal to last_gtid |
| 56 | +--let $assert_cond= "$last_handled_before_gtid" = "$last_gtid" |
| 57 | +--source include/assert.inc |
| 58 | + |
| 59 | +--let $assert_text= Assert that currently $now_handling_action gtid was cleared |
| 60 | +--let $assert_cond= "$now_handling_after_gtid" = "" |
| 61 | +--source include/assert.inc |
| 62 | + |
| 63 | +--let $assert_text= Assert that currently $now_handling_action OCT was cleared |
| 64 | +--let $assert_cond= "$now_handling_after_OCT" = "0000-00-00 00:00:00.000000" |
| 65 | +--source include/assert.inc |
| 66 | + |
| 67 | +--let $assert_text= Assert that currently $now_handling_action ICT was cleared |
| 68 | +--let $assert_cond= "$now_handling_after_ICT" = "0000-00-00 00:00:00.000000" |
| 69 | +--source include/assert.inc |
| 70 | + |
| 71 | +--let $assert_text= Assert that currently $now_handling_action start was cleared |
| 72 | +--let $assert_cond= "$now_handling_after_start" = "0000-00-00 00:00:00.000000" |
| 73 | +--source include/assert.inc |
| 74 | + |
| 75 | +--let $assert_text= Assert that the last $last_handled_action gtid is equal to current_gtid |
| 76 | +--let $assert_cond= "$last_handled_after_gtid" = "$current_gtid" |
| 77 | +--source include/assert.inc |
| 78 | + |
| 79 | +--let $assert_text= Assert that currently $now_handling_action OCT exists |
| 80 | +--let $assert_cond= "$now_handling_before_OCT" != "0000-00-00 00:00:00.000000" |
| 81 | +--source include/assert.inc |
| 82 | + |
| 83 | +--let $assert_text= Assert that currently $now_handling_action ICT exists |
| 84 | +--let $assert_cond= "$now_handling_before_ICT" != "0000-00-00 00:00:00.000000" |
| 85 | +--source include/assert.inc |
| 86 | + |
| 87 | +--let $assert_text= Assert that currently $now_handling_action start_time exists |
| 88 | +--let $assert_cond= "$now_handling_before_start" != "0000-00-00 00:00:00.000000" |
| 89 | +--source include/assert.inc |
| 90 | + |
| 91 | +--let $assert_text= Assert that the OCT of the last $last_handled_action and currently $now_handling_action is the same |
| 92 | +--let $assert_cond= "$now_handling_before_OCT" = "$last_handled_after_OCT" |
| 93 | +--source include/assert.inc |
| 94 | + |
| 95 | +--let $assert_text= Assert that the ICT of the last $last_handled_action and currently $now_handling_action is the same |
| 96 | +--let $assert_cond= "$now_handling_before_ICT" = "$last_handled_after_ICT" |
| 97 | +--source include/assert.inc |
| 98 | + |
| 99 | +--let $assert_text= Assert that the start time of the last $last_handled_action and currently $now_handling_action is the same |
| 100 | +--let $assert_cond= "$now_handling_before_start" = "$last_handled_after_start" |
| 101 | +--source include/assert.inc |
| 102 | + |
| 103 | +--let $unix_ts_end= `SELECT UNIX_TIMESTAMP('$last_handled_after_end')` |
| 104 | +--let $unix_ts_start= `SELECT UNIX_TIMESTAMP('$last_handled_after_start')` |
| 105 | +--let $assert_text= Assert that the end time of the last $last_handled_action is greater than the start time |
| 106 | +--let $assert_cond= $unix_ts_end - $unix_ts_start > 0 |
| 107 | +--source include/assert.inc |
| 108 | + |
0 commit comments