Description:
When executing dba.createCluster() or adding an instance to existing InnoDB Cluster by running cluster.addInstance(), the following errors are logged to MySQL error log:
2020-02-10T10:53:43.727246Z 12 [ERROR] [MY-011685] [Repl] Plugin group_replication reported: 'The group name option is mandatory'
2020-02-10T10:53:43.727292Z 12 [ERROR] [MY-011660] [Repl] Plugin group_replication reported: 'Unable to start Group Replication on boot'
The original operation succeeds without issues, but these are a bit misleading. Errors are logged as a result of group_replication plugin installation by MySQL Shell. The operation is done before any GR options are configured, hence the errors. That's true for both createCluster and addInstance.
Documentation for the GR states that group name must be set in my.cnf before plugin is installed, but InnoDB Cluster generates group name on its own (and passing UUID to createCluster() won't help here).
How to repeat:
Create a cluster and add a second node.
mysqlsh> dba.deploySandboxInstance(3510)
mysqlsh> shell.connect('root@localhost:3510')
mysqlsh> cluster = dba.createCluster('test')
mysqlsh> dba.deploySandboxInstance(3520)
mysqlsh> cluster.addInstance('root@localhost:3520')
Observe the errors reported.
$ grep "ERROR.*group_replication" ~/mysql-sandboxes/35?0/sandboxdata/error.log
/home/sergey.kuzmichev/mysql-sandboxes/3510/sandboxdata/error.log:2020-02-10T12:14:45.887357Z 13 [ERROR] [MY-011685] [Repl] Plugin group_replication reported: 'The group name option is mandatory'
/home/sergey.kuzmichev/mysql-sandboxes/3510/sandboxdata/error.log:2020-02-10T12:14:45.887403Z 13 [ERROR] [MY-011660] [Repl] Plugin group_replication reported: 'Unable to start Group Replication on boot'
/home/sergey.kuzmichev/mysql-sandboxes/3520/sandboxdata/error.log:2020-02-10T12:15:32.425118Z 11 [ERROR] [MY-011685] [Repl] Plugin group_replication reported: 'The group name option is mandatory'
/home/sergey.kuzmichev/mysql-sandboxes/3520/sandboxdata/error.log:2020-02-10T12:15:32.425166Z 11 [ERROR] [MY-011660] [Repl] Plugin group_replication reported: 'Unable to start Group Replication on boot'
Suggested fix:
InnoDB Cluster deployment documentation could say these errors are expected.
MySQL Shell could put a dummy group name to config before trying to install the plugin. In both cases, even the actual group name is known, though I might be mistaken here. However, configuration happens only after plugin is installed/checked.
https://github.com/mysql/mysql-shell/blob/8.0.19/modules/adminapi/dba/create_cluster.cc#L4...
https://github.com/mysql/mysql-shell/blob/8.0.19/modules/adminapi/cluster/replicaset/add_i...
Plugin could show a warning instead of error. Still, per the GR documentation, configuration should be done before plugin installation, so that's probably consistent. https://dev.mysql.com/doc/refman/8.0/en/group-replication-launching.html