1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
######################################################################
# Bug#35199996 table map entry for certain table were logged in to the
# binlogs even though the log_replica_updates is disabled
######################################################################
CREATE TABLE test_log_table_maps (id INT PRIMARY KEY, what VARCHAR(128)) ENGINE = NDB;
SET @save_debug= @@GLOBAL.debug;
SET @@GLOBAL.debug="+d,ndb_binlog_log_table_maps";
SET @@GLOBAL.debug= @save_debug;
# Show data written
SELECT * FROM test_log_table_maps ORDER BY id;
id what
1 change from non replica
2 change from replica
3 change from non replica
4 change from replica
5 change from first replica
6 change from second replica
7 no logging change from replica
8 no logging change from non-replica
9 change from replica
10 no logging change from non-replica
11 no logging change from non-replica
12 read-op change from non-replica
13 no logging change from replica
14 read-op change from replica
15 read-op change from non-replica
16 read-op change from replica
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
binlog.000001 # Query # # use `test`; CREATE TABLE test_log_table_maps (id INT PRIMARY KEY, what VARCHAR(128)) ENGINE = NDB
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
# Verify server1 Binlog changes
# Some rows are not logged because no-logging bit was set
include/ndb_binlog_verify_table.inc
SELECT * FROM verify.test_log_table_maps ORDER BY id;
id what
1 change from non replica
2 change from replica
3 change from non replica
4 change from replica
5 change from first replica
6 change from second replica
9 change from replica
12 read-op change from non-replica
14 read-op change from replica
15 read-op change from non-replica
16 read-op change from replica
[connection server2]
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
binlog.000001 # Query # # use `test`; CREATE TABLE test_log_table_maps (id INT PRIMARY KEY, what VARCHAR(128)) ENGINE = NDB
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
binlog.000001 # Query # # BEGIN
binlog.000001 # Table_map # # table_id: # (test.test_log_table_maps)
binlog.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
binlog.000001 # Write_rows # # table_id: #
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
binlog.000001 # Query # # COMMIT
# Verify server2 Binlog changes
# Additional rows are not logged because server2 does NOT log replica updates
include/ndb_binlog_verify_table.inc
SELECT * FROM verify.test_log_table_maps ORDER BY id;
id what
1 change from non replica
3 change from non replica
12 read-op change from non-replica
14 read-op change from replica
15 read-op change from non-replica
16 read-op change from replica
[connection server1]
DROP TABLE test_log_table_maps;
|