Bug #96657 after mysql native cloning the recipient cannot be cloned again
Submitted: 26 Aug 2019 14:05 Modified: 28 Sep 2019 7:07
Reporter: Mikhail Izioumtchenko (OCA) Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Clone Plugin Severity:S3 (Non-critical)
Version:8.0.17 OS:Any
Assigned to: CPU Architecture:Any

[26 Aug 2019 14:05] Mikhail Izioumtchenko
I recloned server (let's call it Recipient) from server 'Donor' using the clone plugin.
Then I tried to clone it again but this failed because of problems with clone plugin, see 'How to repeat'

How to repeat:
first, I cloned 'Recipient' from 'Donor' following the instruction in the manual. 
Then, I tried to clone 'Recipient' again from the same 'Donor' and got this:

root@Recipient [(none)]> CLONE INSTANCE FROM cloner@'Donor':3306 IDENTIFIED BY 'x';
ERROR 1524 (HY000): Plugin 'clone' is not loaded

so I attempted to load the plugin and got this:

root@Recipient [(none)]>  INSTALL PLUGIN clone SONAME 'mysql_clone.so';  
ERROR 3883 (HY000): Error installing plugin 'clone': got 'Operation not permitted' writing to mysql.plugin

so no apparent way out of this. setting read_only to off or restarting the server did not help. What helped is this

root@Recipient [(none)]> delete from mysql.plugin where name='clone';
Query OK, 1 row affected (0.00 sec)

after this I was able to INSTALL PLUGIN and eventually reclone the server.

Note that because of this problem 'Recipient' cannot immediately be used as a donor for more cloning, either.
[27 Aug 2019 7:29] MySQL Verification Team
Hello Mikhail,

Thank you for the report.
I tried to reproduce this issue at my end but not seeing any issues which you have reported. I'm joining the exact steps from my test environment for your reference. Could you please confirm what other steps required to trigger this issue? Thank you.

[27 Aug 2019 7:29] MySQL Verification Team
Test results - 8.0.17

Attachment: 96657_8.0.17.results (application/octet-stream, text), 9.03 KiB.

[27 Sep 2019 13:42] Mikhail Izioumtchenko
hi Umesh,
looks like what makes cloning to fail is this line in our my.cnf:

sql_require_primary_key = ON

when I replaced ON with OFF I was able to clone repeatedly. 

So this is probably a duplicate of https://bugs.mysql.com/bug.php?id=96281 which is fixed in 8.0.18.
[28 Sep 2019 7:07] MySQL Verification Team
Thank you, Mikhail.
For now, I'll close this as a duplicate of Bug #96281.

[31 Mar 2020 13:54] Peter Hutchison
I am running mysql community server 8.0.19 and when I try to add an instance to my InnodB cluster I keep getting this error:

Cluster.addInstance: error installing plugin 'clone': augusta:3306: Can't initialize function 'clone'; Plugin initialization function failed. (RuntimeError)

I checked that sql_require_primary_key = OFF.
I check that the sql_clone.so plugin is installed in mysql/plugins folder.

So what else would prevent it from installing the plugin?