| 1 |
# ===== Purpose ===== |
| 2 |
# |
| 3 |
# This test verifies that slave_skip_counter works |
| 4 |
# as expected with binlog_transaction_compression |
| 5 |
# and we only skip the expected number of events and |
| 6 |
# not ignore any event. |
| 7 |
# |
| 8 |
# ==== Requirements ===== |
| 9 |
# |
| 10 |
# TC1. sql_replica_skip_counter works correctly with |
| 11 |
# binlog_transaction_compression |
| 12 |
# |
| 13 |
# ==== Implementation ==== |
| 14 |
# |
| 15 |
# 1. Setup a normal source-replica and check that its working fine. |
| 16 |
# |
| 17 |
# 2. Set sql_replica_skip_counter = 2 on replica along |
| 18 |
# |
| 19 |
# 3. Set binlog_transaction_compression = ON on source, and execute |
| 20 |
# few inserts. |
| 21 |
# |
| 22 |
# 4. Verify on replica that only 2 events(Anonymous gtid, Transaction_payload event) which were |
| 23 |
# corresponding to the first INSERT are skipped, and we have exactly 1 entry in the table 't' |
| 24 |
# |
| 25 |
# 5. Drop and create the table again on source |
| 26 |
# |
| 27 |
# 6. Sync slave with master to ensure that the first DROP query was not skipped and all the events are |
| 28 |
# replicated without any error |
| 29 |
# |
| 30 |
# ==== Reference ==== |
| 31 |
# |
| 32 |
# Bug#31973055:SLAVE_SKIP_COUNTER WON'T CONSIDER COMPRESSED TRANSACTIONS |
| 33 |
# |
| 34 |
|
| 35 |
--source include/have_binlog_format_row.inc |
| 36 |
--source include/not_group_replication_plugin.inc |
| 37 |
--source include/master-slave.inc |
| 38 |
|
| 39 |
CREATE TABLE t(a int); |
| 40 |
|
| 41 |
--source include/sync_slave_sql_with_master.inc |
| 42 |
--source include/stop_slave.inc |
| 43 |
SET GLOBAL sql_replica_skip_counter = 1; |
| 44 |
--source include/start_slave.inc |
| 45 |
|
| 46 |
--source include/rpl_connection_master.inc |
| 47 |
--let $saved_binlog_transaction_compression_session_source = `SELECT @@SESSION.binlog_transaction_compression` |
| 48 |
SET SESSION binlog_transaction_compression = ON; |
| 49 |
INSERT INTO t VALUES (10); |
| 50 |
INSERT INTO t VALUES (10); |
| 51 |
--source include/sync_slave_sql_with_master.inc |
| 52 |
|
| 53 |
--let $assert_cond = [SELECT COUNT(*) FROM t] = 1 |
| 54 |
--let $assert_text = There should be exactly 1 row in table t |
| 55 |
--source include/assert.inc |
| 56 |
|
| 57 |
--source include/rpl_connection_master.inc |
| 58 |
DROP TABLE t; |
| 59 |
CREATE TABLE t(a int); |
| 60 |
DROP TABLE t; |
| 61 |
|
| 62 |
--replace_result $saved_binlog_transaction_compression_session_source BINLOG_TRANSACTION_COMPRESSION_SOURCE |
| 63 |
--eval SET SESSION binlog_transaction_compression = $saved_binlog_transaction_compression_session_source |
| 64 |
# No error here |
| 65 |
--source include/sync_slave_sql_with_master.inc |
| 66 |
|
| 67 |
--source include/rpl_end.inc |