[MDEV-9312] storage engine not enforced during galera cluster replication Created: 2015-12-22  Updated: 2016-11-07  Resolved: 2016-09-29

Status: Closed
Project: MariaDB Server
Component/s: Galera, Replication
Affects Version/s: 10.1.9
Fix Version/s: 10.1.18

Type: Bug Priority: Critical
Reporter: Orru Assignee: Nirbhay Choubey (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Environment:

CentOS 7.1, installed from repo: http://yum.mariadb.org/10.1/centos7-amd64


Sprint: 10.1.18

 Description   

Hi,
we have a problem using enforce_storage_engine variable set to InnoDB.
We have three servers in cluster (multi masters).
When we issue create table with engine=MyISAM the engine is correctly enforced to InnoDB only on the node we are connected to. On the other nodes the replicated table is created as MyISAM.
In our servers configuration (the same on all nodes) we have:

enforce_storage_engine='InnoDB'
wsrep_on=ON
sql_mode=''

Some console output follows.
On the first node we have:

MariaDB [galera_test]> SHOW VARIABLES WHERE Variable_name='enforce_storage_engine' OR Variable_name='sql_mode';
+------------------------+--------+
| Variable_name          | Value  |
+------------------------+--------+
| enforce_storage_engine | InnoDB |
| sql_mode               |        |
+------------------------+--------+
2 rows in set (0.00 sec)
 
MariaDB [galera_test]> CREATE TABLE table_1(id INTEGER) ENGINE=InnoDB;
Query OK, 0 rows affected (0.01 sec)
 
MariaDB [galera_test]> CREATE TABLE table_2(id INTEGER) ENGINE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.00 sec)
 
MariaDB [galera_test]> SHOW WARNINGS;
+-------+------+-------------------------------------------------+
| Level | Code | Message                                         |
+-------+------+-------------------------------------------------+
| Note  | 1266 | Using storage engine InnoDB for table 'table_2' |
+-------+------+-------------------------------------------------+
1 row in set (0.00 sec)
 
MariaDB [galera_test]>  SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'galera_test';
+------------+--------+
| TABLE_NAME | ENGINE |
+------------+--------+
| table_1    | InnoDB |
| table_2    | InnoDB |
+------------+--------+
2 rows in set (0.00 sec)

Creating table_2 creation we obtain a warning, table_2 is correctly created using InnoDB, and until this point, everything is working great.
When we check the same table on another cluster node, we have:

MariaDB [galera_test]> SHOW VARIABLES WHERE Variable_name='enforce_storage_engine' OR Variable_name='sql_mode';
+------------------------+--------+
| Variable_name          | Value  |
+------------------------+--------+
| enforce_storage_engine | InnoDB |
| sql_mode               |        |
+------------------------+--------+
2 rows in set (0.00 sec)
 
MariaDB [galera_test]>  SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'galera_test';
+------------+--------+
| TABLE_NAME | ENGINE |
+------------+--------+
| table_1    | InnoDB |
| table_2    | MyISAM |
+------------+--------+
2 rows in set (0.00 sec)
 
MariaDB [galera_test]> SHOW TABLE STATUS WHERE Name = 'table_2';
+---------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+
| Name    | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length  | Index_length | Data_free | Auto_increment | Create_time         | Update_time         | Check_time | Collation         | Checksum | Create_options | Comment |
+---------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+
| table_2 | MyISAM |      10 | Fixed      |    0 |              0 |           0 | 1970324836974591 |         1024 |         0 |           NULL | 2015-12-22 11:08:34 | 2015-12-22 11:08:34 | NULL       | latin1_swedish_ci |     NULL |                |         |
+---------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+
1 row in set (0.00 sec)

As you can read, creating a MyISAM table (table_2) on the first node produces a correct InnoDB table, but replication of the same table on the other cluster nodes happens using MyISAM engine.
It seems like engine enforcing is used during creation but not during replication....



 Comments   
Comment by Nirbhay Choubey (Inactive) [ 2016-06-06 ]

https://github.com/MariaDB/server/commit/c9f05974e618a869563f2360ef1ca910974a4f1c

Comment by Nirbhay Choubey (Inactive) [ 2016-09-24 ]

http://lists.askmonty.org/pipermail/commits/2016-September/009913.html

Comment by Nirbhay Choubey (Inactive) [ 2016-09-27 ]

http://lists.askmonty.org/pipermail/commits/2016-September/009932.html

Generated at Thu Feb 08 07:33:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.