DDL is replicated even when sql_log_bin=0, and GTID is incremented in remote node
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.6 |
Fix Released
|
Undecided
|
Unassigned | |||
5.7 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
On PXC 5.7.18, CREATE TABLE is replicated even when sql_log_bin=0; And on top of that, GTID is incremented in remote node but not where the CREATE has run:
On node1:
PXC: root@localhost (sbtest) > show master status\G
*******
File: pxc1-bin.000006
Position: 1065
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: f1474806-
1 row in set (0.00 sec)
PXC: root@localhost (sbtest) > set sql_log_bin=0;
Query OK, 0 rows affected (0.00 sec)
PXC: root@localhost (sbtest) > create table nobinlog (i int not null auto_increment primary key) engine innodb;
Query OK, 0 rows affected (0.00 sec)
-- after the CREATE the local GTID was NOT incremented
PXC: root@localhost (sbtest) > show master status\G
*******
File: pxc1-bin.000006
Position: 1065
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: f1474806-
1 row in set (0.00 sec)
On node2:
-- before the CREATE
PXC: root@localhost ((none)) > show master status\G
*******
File: pxc2-bin.000002
Position: 641
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: f1474806-
1 row in set (0.00 sec)
-- after the CREATE GTID was in fact incremented
PXC: root@localhost ((none)) > show master status\G
*******
File: pxc2-bin.000002
Position: 863
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: f1474806-
1 row in set (0.00 sec)
PXC: root@localhost ((none)) > use sbtest;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
-- and the table was replicated!
Database changed
PXC: root@localhost (sbtest) > show tables;
+------
| Tables_in_sbtest |
+------
| nobinlog |
| sbtest1 |
+------
2 rows in set (0.00 sec)
Not sure whether to file separate bug; Critical part seems to be the GTID bit since it makes the sequence inconsistent. But replicating tables when it's not desired seems a bug as well. If a separate bug is necessary, keep this for GTID part please and Support will file separate one.
Sample cnf:
[root@pxc2 /]# cat /etc/my.cnf
[mysql]
port = 3306
socket = /var/lib/
prompt='PXC: \u@\h (\d) > '
[client]
port = 3306
socket = /var/lib/
[mysqld]
socket = /var/lib/
datadir=
user=mysql
wsrep_cluster_
wsrep_provider=
wsrep_provider_
wsrep_slave_threads = 2
wsrep_auto_
wsrep_sst_
wsrep_sst_
wsrep_cluster_
wsrep_node_
wsrep_node_
innodb_
innodb_
innodb_
innodb-
innodb-
innodb-
innodb_
log_bin
server_id=1
log_slave_updates
binlog_format=ROW
enforce_
gtid_mode=on
[sst]
streamfmt=xbstream
Changed in percona-xtradb-cluster: | |
status: | New → Confirmed |
Confirming bug on 5.6 as well but slightly different outcome:
On node1: ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+ ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+ 5c99-11e7- b402-00163e4de3 0b:1-4 | ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+
mysql> show master status;
+------
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------
| mysql-bin.000003 | 191 | | | 34408038-
+------
1 row in set (0.00 sec)
mysql> select @@sql_log_bin;
+---------------+
| @@sql_log_bin |
+---------------+
| 1 |
+---------------+
1 row in set (0.00 sec)
mysql> select @@global. sql_log_ bin; ------- ------- --+ sql_log_ bin | ------- ------- --+ ------- ------- --+
+------
| @@global.
+------
| 1 |
+------
1 row in set (0.00 sec)
mysql> set sql_log_bin=0;
Query OK, 0 rows affected (0.01 sec)
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> create table nobinlog (id int primary key auto_increment not null, s varchar(10)) engine=innodb;
Query OK, 0 rows affected (0.03 sec)
mysql> show master status; ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+ ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+ 5c99-11e7- b402-00163e4de3 0b:1-4 | ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+
+------
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------
| mysql-bin.000003 | 191 | | | 34408038-
+------
1 row in set (0.00 sec)
One node2: ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+ ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+ 5c99-11e7- b402-00163e4de3 0b:1-4 | ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- --+
before create table:
mysql> show master status;
+------
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------
| mysql-bin.000004 | 191 | | | 34408038-
+------
1 row in set (0.00 sec)
after create table: ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- + ------- -----+- ------- --+---- ------- ---+--- ------- ------- -+----- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- + 5c99-11e7- b402-00163e4de3 0b:1-4,
mysql> show master status;
+------
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------
| mysql-bin.000004 | 408 | | | 34408038-
4...