Bug #80962 Replication does not work when @@GLOBAL.SERVER_UUID is missing on the master
Submitted: 5 Apr 2016 15:57 Modified: 1 Jul 2016 10:38
Reporter: Kenny Gryp Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution, replication

[5 Apr 2016 15:57] Kenny Gryp
In commit https://github.com/mysql/mysql-server/commit/14d664f0ddca7c69d44599693ffcd3455557e7e6#diff..., the code that fetches the SERVER_UUID changed from SHOW GLOBAL VARIABLES to SELECT @@GLOBAL, which now returns an error if the variable is not there instead of an empty row.

However, as you can see in https://github.com/grypyrg/percona-server/blob/5.7/sql/rpl_slave.cc#L2429-L2437 the code actually catches the non presence of a row which is using the SHOW GLOBAL VARIABLES way.

This patch just made it handle SELECT @@GLOBAL properly.

This caused any replication from MySQL < 5.6 to MySQL 5.7 to break.

How to repeat:
setup replication between 55 and 57

Suggested fix:
See attached patch
[5 Apr 2016 15:57] Kenny Gryp

Attachment: replication_55_57.patch (application/octet-stream, text), 1.32 KiB.

[5 Apr 2016 16:03] Kenny Gryp
(Thanks to Ceri Williams for finding the broken code)
[5 Apr 2016 21:38] Miguel Solorzano
Please check for related bug: http://bugs.mysql.com/bug.php?id=79539. Thanks.
[5 Apr 2016 22:10] Kenny Gryp
Yes, the related bug #79539 shows that the condition will never be used.

The patch I added does not remove the condition, but moves the condition to where it now belongs, to adapt along with the change from SHOW GLOBAL VARIABLES to SELECT @@GLOBAL.

if not, you can't replicate from a master that has no server_uuid at all, which is reported in bug #79272
[5 Apr 2016 22:14] Kenny Gryp
55 to 57 replication is broken ONLY BECAUSE fetching the server_uuid from the master changed from SHOW GLOBAL VARIABLES to SELECT @@GLOBAL. 
There is no other known reason why replication from 55 to 57 would not work.

I know that replication from 55 to 57 is not officially supported according to the mysql documentation, 
but I recommend to consider fixing this bug anyway. It doesn't automatically mean you have to start officially support 55 to 57.
[6 Apr 2016 12:27] Umesh Shastry
Thank you for the feedback!
In order to submit contributions you must first sign the Oracle Contribution Agreement (OCA). For additional information please check http://www.oracle.com/technetwork/community/oca-486395.html

If you have any questions, please contact the MySQL community team at http://www.mysql.com/about/contact/?topic=community
[1 Jul 2016 10:38] Erlend Dahl
[20 May 2016 8:42] David Moss

This has been fixed in upcoming versions and the following was added to the
5.7.13 changelog:

Slaves running MySQL 5.7 could not connect to a MySQL 5.5 master due to an
error retrieving the server_uuid, which is not part of MySQL 5.5. This was
caused by changes in the method of retrieving the server_uuid.

(Fixed without using the contribution.)