| 1 |
-- source include/have_ndb.inc |
| 2 |
-- source include/have_binlog_format_mixed_or_row.inc |
| 3 |
-- source suite/ndb_rpl/ndb_master-slave.inc |
| 4 |
|
| 5 |
# Minimal test checking that relay log position on the slave |
| 6 |
# is advanced when NDB binlog injector writes compressed binlog. |
| 7 |
# |
| 8 |
# Without fix for BUG#33889030 the applier wouldn't update |
| 9 |
# the relay log positions when using parallel workers and |
| 10 |
# thus waiting for replication sync stopped. Test is written to |
| 11 |
# work regardless of number of workers used on the replica |
| 12 |
# although problem only occured when using at least one worker. |
| 13 |
|
| 14 |
# Turn on compression |
| 15 |
--source include/rpl_connection_master.inc |
| 16 |
--let $save_binlog_compression=`SELECT @@global.ndb_log_transaction_compression` |
| 17 |
SET GLOBAL ndb_log_transaction_compression=ON; |
| 18 |
|
| 19 |
# Reset compression stats |
| 20 |
TRUNCATE performance_schema.binary_log_transaction_compression_stats; |
| 21 |
|
| 22 |
# Create table and insert data |
| 23 |
--source include/rpl_connection_master.inc |
| 24 |
CREATE TABLE t1 ( a int primary key, b varchar(32)) ENGINE = NDB; |
| 25 |
INSERT INTO t1 VALUES (1, "Row 1"), (2, "Row 2"), (3, "Row 3"); |
| 26 |
|
| 27 |
# Wait for NDB binlog injector epoch |
| 28 |
--save_master_pos |
| 29 |
|
| 30 |
# Check binlog compression stats for compressed bytes |
| 31 |
let $cbytes = |
| 32 |
`SELECT compressed_bytes_counter |
| 33 |
FROM performance_schema.binary_log_transaction_compression_stats |
| 34 |
WHERE log_type = 'BINARY'`; |
| 35 |
#echo Compressed bytes: $cbytes; |
| 36 |
if ($cbytes == 0) { |
| 37 |
die The binary log contained no compressed bytes; |
| 38 |
} |
| 39 |
|
| 40 |
# Wait for replication sync |
| 41 |
--source include/sync_slave_sql_with_master.inc |
| 42 |
|
| 43 |
# Check that tables are identical |
| 44 |
let $diff_tables = master:t1,slave:t1; |
| 45 |
--source include/diff_tables.inc |
| 46 |
|
| 47 |
# drop table |
| 48 |
--source include/rpl_connection_master.inc |
| 49 |
DROP TABLE t1; |
| 50 |
--source include/sync_slave_sql_with_master.inc |
| 51 |
|
| 52 |
# Cleanup |
| 53 |
--source include/rpl_connection_master.inc |
| 54 |
--disable_query_log ONCE |
| 55 |
eval SET GLOBAL ndb_log_transaction_compression=$save_binlog_compression; |
| 56 |
|
| 57 |
--source include/rpl_end.inc |
| 58 |
|