Bug #87599 The instance is already part of a Replication Group (RuntimeError)
Submitted: 30 Aug 2017 7:58 Modified: 26 Sep 2017 11:22
Reporter: Yoshihiro Ozawa Email Updates:
Status: Verified Impact on me:
None 
Category:Shell AdminAPI InnoDB Cluster / ReplicaSet Severity:S3 (Non-critical)
Version:1.10 OS:Red Hat (7.3)
Assigned to: CPU Architecture:Any

[30 Aug 2017 7:58] Yoshihiro Ozawa
Description:
I built Group Replication in advance
An error occurred when CreateCluster was executed using mysql-shell.
After downgrading mysql-shell version to 1.0.9 it succeeded

How to repeat:
mysql-js> shell.connect("xxxxxx@xxxxxxxxxx:3306")
Please provide the password for 'xxxxxx@xxxxxxxxxx:3306': 
Creating a Session to 'xxxxxx@xxxxxxxxxx:3306'
Your MySQL connection id is 19
No default schema selected; type \use <schema> to set one.
mysql-js> var cluster = dba.createCluster("InnoDBCluster", {adoptFromGR: true})
A new InnoDB cluster will be created on instance 'xxxxxx@xxxxxxxxxx:3306'.

Dba.createCluster: Dba.checkInstanceConfiguration: The instance 'xxxxxx@xxxxxxxxxx:3306' is already part of a Replication Group (RuntimeError)
[1 Sep 2017 21:45] MySQL Verification Team
Hi,

I apologize I'm not sure I understand what bug you are reporting?

Your self build shell is failing? From where did you get what version of sources?

thanks
Bogdan
[26 Sep 2017 9:44] Victor L
Hi,
I can confirm this bug. I reproduce it exactly.

My setup:
-3 virtual machines running CentOS Linux release 7.4.1708 (Core)
-On each VM:
-- mysql-server-community 5.7.19
-- mysql-shell 1.0.10
-- hosts file
10.0.0.51   mysql-test-01
10.0.0.52   mysql-test-02
10.0.0.53   mysql-test-03

- "manually build" replication cluster using configuration file, replication group bootstrap on first member and "start group_replication" on 2 others members.

To work with MySQL router, I need to create an InnoDB cluster using MySQL Shell in order for this tool to create metadata in database (if I understand correctly the process).

With MySQL Shell 1.0.10
------------------------------
[root@mysql-test-01 ~]# mysqlsh –uri=mysqlshell_user@mysql-test-02:3306
Creating a Session to ‘mysqlshell_user@mysql-test-02:3306’
Enter password:
Your MySQL connection id is 43
Server version: 5.7.19-log MySQL Community Server (GPL)
No default schema selected; type \use to set one.
MySQL Shell 1.0.10

Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘\help’ or ‘\?’ for help; ‘\quit’ to exit.

Currently in JavaScript mode. Use \sql to switch to SQL mode and execute queries.
mysql-js>
mysql-js> A new InnoDB cluster will be created on instance ‘mysqlshell_user@mysql-test-02:’.
SyntaxError: Unexpected token new
mysql-js> var cluster=dba.createCluster(‘testCluster’, {adoptFromGR: true})
A new InnoDB cluster will be created on instance ‘mysqlshell_user@mysql-test-02:3306’.

Dba.createCluster: Dba.checkInstanceConfiguration: The instance ‘mysqlshell_user@mysql-test-02:3306’ is already part of a Replication Group (RuntimeError)
------------------------------

After downgrading to 1.0.9
------------------------------
[root@mysql-test-01 ~]# mysqlsh --uri=mysqlshell_user@mysql-test-02:3306
Creating a Session to 'mysqlshell_user@mysql-test-02:3306'
Enter password: 
Classic Session successfully established. No default schema selected.
Welcome to MySQL Shell 1.0.9

Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type '\help', '\h' or '\?' for help, type '\quit' or '\q' to exit.

Currently in JavaScript mode. Use \sql to switch to SQL mode and execute queries.
mysql-js> \status
MySQL Shell Version 1.0.9

Session type:                 Classic
Connection Id:                47
Default schema:               
Current schema:               
Current user:                 mysqlshell_user@mysql-test-01
SSL: Cipher in use:           DHE-RSA-AES256-SHA
Server version:               MySQL Community Server (GPL)
Server info:                  5.7.19-log
Protocol version:             10
Connection:                   mysql-test-02 via TCP/IP
Server characterset:          latin1
Schema characterset:          latin1
Client characterset:          latin1
Conn. characterset:           latin1
Up time:                      17 hours, 21 minutes, 10 sec

Threads: 5  Questions: 168  Slow queries: 0  Opens: 145  Flush tables: 1  Open tables: 138  Queries per second avg: 0.002
mysql-js> var cluster=dba.createCluster("testCluster", {adoptFromGR: true, ipWhitelist: "10.0.0.51,10.0.0.52,10.0.0.53"})
A new InnoDB cluster will be created on instance 'mysqlshell_user@mysql-test-02:3306'.

Creating InnoDB cluster 'testCluster' on 'mysqlshell_user@mysql-test-02:3306'...
Adding Seed Instance...

Cluster successfully created. Use Cluster.addInstance() to add MySQL instances.
At least 3 instances are needed for the cluster to be able to withstand up to
one server failure.
------------------------------
[26 Sep 2017 11:22] MySQL Verification Team
Thanks for clarification :) 

Verified as described
Bogdan
[26 Apr 2018 11:21] Herb Guo
Hello:

I have the same problem to Solve.

I want to know whether the latest version has solved this problem ?

Or is there any effective way to solve this problem ?

Thanks !