Description:
The MySQL Fabric table schemes are not compliant in combination with Group Replication, because there are some tables without primary key.
How to repeat:
1. Setup a database cluster with MySQL Group Replication
2. Setup MySQL Fabric to use the database server with Group Replication
3. Run `mysqlfabric manage setup`
4. Run `mysqlfabric manage start`
== Result ==
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/mysql/fabric/handler.py", line 303, in emit
self.format(record), info_category, info_type
File "/usr/lib/python2.7/dist-packages/mysql/fabric/persistence.py", line 136, in _wrap
return original(*args, **kwrds)
File "/usr/lib/python2.7/dist-packages/mysql/fabric/handler.py", line 208, in add
info_type)}
File "/usr/lib/python2.7/dist-packages/mysql/fabric/persistence.py", line 511, in exec_stmt
return self.__cnx.exec_stmt(stmt_str, options)
File "/usr/lib/python2.7/dist-packages/mysql/fabric/connection.py", line 150, in exec_stmt
(stmt_str, params, self.address(), error), errno
DatabaseError: Command (INSERT INTO log (subject, reported, reporter, message, category, type) VALUES(%s, %s, %s, %s, %s, %s), ('0', datetime.datetime(2016, 9, 27, 8, 4, 41), 'mysql.fabric.services.manage', 'Fabric node starting.', 0, 0)) failed accessing (database:3306). 3098 (HY000): The table does not comply with the requirements by an external plugin..
Suggested fix:
There are two tables without a primary key. Add a column with a primary key and the problem is resolved.
ALTER TABLE `log` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `shard_ranges` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;