|
| 1 | +--source ../include/have_binsrv.inc |
| 2 | + |
| 3 | +--source ../include/v80_v84_compatibility_defines.inc |
| 4 | + |
| 5 | +# in case of --repeat=N, we need to start from a fresh binary log to make |
| 6 | +# this test deterministic |
| 7 | +--echo *** Resetting replication at the very beginning of the test. |
| 8 | +--disable_query_log |
| 9 | +eval $stmt_reset_binary_logs_and_gtids; |
| 10 | +--enable_query_log |
| 11 | + |
| 12 | +# identifying backend storage type ('file' or 's3') |
| 13 | +--source ../include/identify_storage_backend.inc |
| 14 | + |
| 15 | +# identifying utility buffering mode from the conbination |
| 16 | +--let $extracted_init_connect_variable_name = binsrv_buffering_mode |
| 17 | +--source ../include/extract_init_connect_variable_value.inc |
| 18 | + |
| 19 | +# creating data directory, configuration file, etc. |
| 20 | +--let $binsrv_connect_timeout = 20 |
| 21 | +--let $binsrv_read_timeout = 60 |
| 22 | +--let $binsrv_idle_time = 10 |
| 23 | +--let $binsrv_verify_checksum = TRUE |
| 24 | +--let $binsrv_replication_mode = `SELECT IF(@@global.gtid_mode, 'gtid', 'position')` |
| 25 | +if ($extracted_init_connect_variable_value == 'buffered') |
| 26 | +{ |
| 27 | + --let $binsrv_checkpoint_size = 1G |
| 28 | +} |
| 29 | +if ($extracted_init_connect_variable_value == 'unbuffered') |
| 30 | +{ |
| 31 | + --let $binsrv_checkpoint_size = 1 |
| 32 | +} |
| 33 | +--source ../include/set_up_binsrv_environment.inc |
| 34 | + |
| 35 | +--echo |
| 36 | +--echo *** 1. Executing the Binlog Server utility to for the very first |
| 37 | +--echo *** time on an empty storage and receive no real events. |
| 38 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 39 | + |
| 40 | +--echo |
| 41 | +--echo *** 1a. Executing the Binlog Server utility on a storage that has |
| 42 | +--echo *** only one binlog file that has only magic payload in it and |
| 43 | +--echo *** receive no events. |
| 44 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 45 | + |
| 46 | +--echo |
| 47 | +--echo *** Creating a simple table |
| 48 | +CREATE TABLE t1(id INT UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)) ENGINE=InnoDB; |
| 49 | + |
| 50 | +--echo |
| 51 | +--echo *** 2. Executing the Binlog Server utility on a storage that has |
| 52 | +--echo *** only one binlog file that has only magic payload in it and |
| 53 | +--echo *** receive events from the CREATE TABLE transaction. |
| 54 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 55 | + |
| 56 | +--echo |
| 57 | +--echo *** 2a. Executing the Binlog Server utility on a storage that has |
| 58 | +--echo *** only one binlog file that has CREATE TABLE transaction and |
| 59 | +--echo *** receive no events. |
| 60 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 61 | + |
| 62 | +--echo |
| 63 | +--echo *** Filling the table with some data (one transaction with one |
| 64 | +--echo *** insert and another one with two inserts). |
| 65 | +INSERT INTO t1 VALUES(DEFAULT); |
| 66 | +START TRANSACTION; |
| 67 | +INSERT INTO t1 VALUES(DEFAULT); |
| 68 | +INSERT INTO t1 VALUES(DEFAULT); |
| 69 | +COMMIT; |
| 70 | + |
| 71 | +--echo |
| 72 | +--echo *** 3. Executing the Binlog Server utility on a storage that has |
| 73 | +--echo *** only one binlog file with some data and receive events from |
| 74 | +--echo *** the INSERT transactions. |
| 75 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 76 | + |
| 77 | +--echo |
| 78 | +--echo *** 3a. Executing the Binlog Server utility on a storage that has |
| 79 | +--echo *** only one binlog file with some data and receive no events. |
| 80 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 81 | + |
| 82 | +--echo |
| 83 | +--echo *** Flushing the first binary log and switching to the second one. |
| 84 | +FLUSH BINARY LOGS; |
| 85 | + |
| 86 | +--echo |
| 87 | +--echo *** 4. Executing the Binlog Server utility on a storage that has |
| 88 | +--echo *** only one binlog file with some data and receive a single |
| 89 | +--echo *** ROTATE event. |
| 90 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 91 | + |
| 92 | +--echo |
| 93 | +--echo *** 4a. Executing the Binlog Server utility on a storage that has |
| 94 | +--echo *** one binlog file with some data and another one with just |
| 95 | +--echo *** magic payload and receive no events. |
| 96 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 97 | + |
| 98 | +--echo |
| 99 | +--echo *** Filling the table with some more data (one transaction with one |
| 100 | +--echo *** insert and another one with two inserts). |
| 101 | +INSERT INTO t1 VALUES(DEFAULT); |
| 102 | +START TRANSACTION; |
| 103 | +INSERT INTO t1 VALUES(DEFAULT); |
| 104 | +INSERT INTO t1 VALUES(DEFAULT); |
| 105 | +COMMIT; |
| 106 | + |
| 107 | +--echo |
| 108 | +--echo *** 5. Executing the Binlog Server utility on a storage that has |
| 109 | +--echo *** one binlog file with some data and another one with just |
| 110 | +--echo *** magic payload and receive events from the second group of |
| 111 | +--echo *** INSERT transactions. |
| 112 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 113 | + |
| 114 | +--echo |
| 115 | +--echo *** 5a. Executing the Binlog Server utility on a storage that has |
| 116 | +--echo *** two binlog files with some data and receive no events |
| 117 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 118 | + |
| 119 | +--echo |
| 120 | +--echo *** Flushing the second binary log and switching to the third one. |
| 121 | +--echo *** Immediately after that updating data inserted previously. |
| 122 | +FLUSH BINARY LOGS; |
| 123 | +UPDATE t1 SET id = id + 100; |
| 124 | + |
| 125 | +--echo |
| 126 | +--echo *** 6. Executing the Binlog Server utility on a storage that has |
| 127 | +--echo *** two binlog files with some data and receive a ROTATE event |
| 128 | +--echo *** followed by events from the UPDATE transaction |
| 129 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 130 | + |
| 131 | +--echo |
| 132 | +--echo *** 6a. Executing the Binlog Server utility on a storage that has |
| 133 | +--echo *** three binlog files with some data and receive no events. |
| 134 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 135 | + |
| 136 | +--echo |
| 137 | +--echo *** Flushing the third binary log and switching to the fourth one. |
| 138 | +--echo *** Immediately after that deleting some data updated previously and |
| 139 | +--echo *** flushing one more time switching to the fifth binary log file. |
| 140 | +FLUSH BINARY LOGS; |
| 141 | +DELETE FROM t1 WHERE id <= 103; |
| 142 | +FLUSH BINARY LOGS; |
| 143 | + |
| 144 | +--echo |
| 145 | +--echo *** 7. Executing the Binlog Server utility on a storage that has |
| 146 | +--echo *** three binlog files with some data and receive a ROTATE |
| 147 | +--echo *** event followed by a events from the DELETE transaction |
| 148 | +--echo *** followed by another ROTATE event |
| 149 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 150 | + |
| 151 | +--echo |
| 152 | +--echo *** 7a. Executing the Binlog Server utility on a storage that has |
| 153 | +--echo *** five binlog files with some data and receive no events. |
| 154 | +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null |
| 155 | + |
| 156 | +--echo |
| 157 | +--echo *** Dropping the table. |
| 158 | +DROP TABLE t1; |
| 159 | + |
| 160 | +# cleaning up |
| 161 | +--source ../include/tear_down_binsrv_environment.inc |
0 commit comments