Bug #100291 Clone plugin expects the exact same version for the recipient and the donor
Submitted: 22 Jul 2020 13:56 Modified: 5 Aug 2020 12:51
Reporter: Stephane Combaudon Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Clone Plugin Severity:S3 (Non-critical)
Version:8.0.17+ OS:Any
Assigned to: CPU Architecture:Any

[22 Jul 2020 13:56] Stephane Combaudon
Description:
If the clone donor is using an "old" MySQL version, like 8.0.19, it cannot be used to provision a server using a newer MySQL version, like 8.0.20.

While the documentation states that "An instance cannot be cloned from a different MySQL server version", I would assume this should be supported as long as recipient and donor are using the same major version and the version of the recipient is equal or greater than the version of the donor.

How to repeat:
- Prepare a donor instance with MySQL 8.0.19.
- Prepare an empty recipient instance with MySQL 8.0.20.
- When running "CLONE INSTANCE FROM ..." from the recipient, you get an error like this one:
ERROR 3864 (HY000): Clone Donor MySQL version: 8.0.19-10 is different from Recipient MySQL version 8.0.20-11.

Suggested fix:
- Allow the recipient and the donor to have different minor versions.
- If this is not possible, make the limitation more explicit in the documentation.
[23 Jul 2020 8:09] MySQL Verification Team
Hello Stephane,

Thank you for the report and feedback.

regards,
Umesh
[23 Jul 2020 8:12] MySQL Verification Team
- Donor (8.0.20)
rm -rf 100291/
bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/100291 --log-error-verbosity=3
bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/100291 --core-file --socket=/tmp/mysql_D_ushastry.sock  --port=3333 --log-error=$PWD/100291/log.err --mysqlx-port=33330 --mysqlx-socket=/tmp/mysql_x_ushastry.sock --log-error-verbosity=3  --secure-file-priv=/tmp/ 2>&1 &

bin/mysql -uroot -S /tmp/mysql_D_ushastry.sock --prompt='Donor>'
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.20 MySQL Community Server - GPL

Copyright (c) 2000, 2020, 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 '\h' for help. Type '\c' to clear the current input statement.

Donor>
Donor>INSTALL PLUGIN clone SONAME 'mysql_clone.so';
Query OK, 0 rows affected (0.05 sec)

Donor>CREATE USER clone_user IDENTIFIED BY "clone_password";
Query OK, 0 rows affected (0.00 sec)

Donor>GRANT BACKUP_ADMIN ON *.* to clone_user;
Query OK, 0 rows affected (0.00 sec)

Donor>GRANT SELECT ON performance_schema.* TO clone_user;
Query OK, 0 rows affected (0.01 sec)

Donor>GRANT EXECUTE ON *.* to clone_user;
Query OK, 0 rows affected (0.00 sec)

Donor>

- Recipient (8.0.21)

rm -rf 100291/
bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/100291 --log-error-verbosity=3
bin/mysqld_safe --no-defaults --basedir=$PWD --datadir=$PWD/100291 --core-file --socket=/tmp/mysql_R_ushastry.sock  --port=3336 --log-error=$PWD/100291/log.err --mysqlx-port=33360 --mysqlx-socket=/tmp/mysql_xx_ushastry.sock --log-error-verbosity=3  --secure-file-priv=/tmp/ 2>&1 &

bin/mysql -uroot -S /tmp/mysql_R_ushastry.sock --prompt='Recipient>'
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.21 MySQL Community Server - GPL

Copyright (c) 2000, 2020, 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 '\h' for help. Type '\c' to clear the current input statement.

Recipient>INSTALL PLUGIN clone SONAME 'mysql_clone.so';
Query OK, 0 rows affected (0.02 sec)

Recipient>CREATE USER clone_user IDENTIFIED BY "clone_password";
Query OK, 0 rows affected (0.00 sec)

Recipient>GRANT BACKUP_ADMIN ON *.* to clone_user;
Query OK, 0 rows affected (0.01 sec)

Recipient>GRANT SELECT ON performance_schema.* TO clone_user;
Query OK, 0 rows affected (0.00 sec)

Recipient>GRANT EXECUTE ON *.* to clone_user;
Query OK, 0 rows affected (0.00 sec)

Recipient>SHOW VARIABLES LIKE 'clone_valid_donor_list';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| clone_valid_donor_list |       |
+------------------------+-------+
1 row in set (0.04 sec)

Recipient>SET GLOBAL clone_valid_donor_list = "hod03.no.oracle.com:3333";
Query OK, 0 rows affected (0.00 sec)

Recipient>SHOW VARIABLES LIKE 'clone_valid_donor_list';
+------------------------+--------------------------+
| Variable_name          | Value                    |
+------------------------+--------------------------+
| clone_valid_donor_list | hod03.no.oracle.com:3333 |
+------------------------+--------------------------+
1 row in set (0.00 sec)

Recipient>
Recipient>CLONE INSTANCE FROM clone_user@hod03.no.oracle.com:3333 IDENTIFIED BY 'clone_password';
ERROR 3864 (HY000): Clone Donor MySQL version: 8.0.20 is different from Recipient MySQL version 8.0.21.
Recipient>

### Per https://dev.mysql.com/doc/refman/8.0/en/clone-plugin-limitations.html

Quoting from manual "An instance cannot be cloned from a different MySQL server version. The donor and recipient must have the same MySQL server version. For example, you cannot clone between MySQL 5.7 and MySQL 8.0. The clone plugin is only supported in MySQL 8.0.17 and higher. "

If the behavior is expected then may be above documentation can be elaborated  that instance cannot be cloned even for minor server version difference
[28 Jul 2020 4:20] MySQL Verification Team
Bug #100338 marked as duplicate of this one
[5 Aug 2020 12:51] Daniel Price
Posted by developer:
 
The documentation was revised as suggested. The change should appear online soon.
Thank you for the bug report.