Bug #90107 | RSync through snapshot using Multi-Thread replication fails because of duplicate | ||
---|---|---|---|
Submitted: | 16 Mar 2018 11:18 | Modified: | 20 Apr 2018 7:50 |
Reporter: | Andrea Dante Bozzola | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.7.21-enterprise-commercial-advanced-lo | OS: | CentOS (6.9 (Final)) |
Assigned to: | MySQL Verification Team | CPU Architecture: | Any (x86_64) |
[16 Mar 2018 11:18]
Andrea Dante Bozzola
[20 Mar 2018 21:50]
MySQL Verification Team
Hi, I don't believe we shown the "flush tables with read lock; then take snapshot" in our documentation as a safe thing to do with innodb. Please correct me if I'm wrong. Thanks Bogdan
[28 Mar 2018 9:18]
Andrea Dante Bozzola
Hi Bogdan the documentation for FLUSH TABLES does not specify anything about INNODB (https://dev.mysql.com/doc/refman/5.7/en/flush.html), nor anything is specified in the "How MySQL Handles FLUSH TABLES" (https://dev.mysql.com/doc/internals/en/flush-tables.html) page. If this is not the best way to handle it we are open to suggestions, we are not aware of any other way to lock the tables in a consistent state and we have used the same procedure so far with no errors on single-threaded replication.
[2 Apr 2018 14:05]
MySQL Verification Team
Hi, Well nowhere is stated that it's safe to copy raw binary files (except for myisam) in any situation with mysql so.. it is not a safe thing normally. You can do it in some cases but there are issues as you seen. mysql backup could be solution https://www.mysql.com/products/enterprise/backup.html I tried to backup with mysqlbackup, instead flush/rsync, and was not able to reproduce the problem. Now, to be sure I did not miss something you can try to reproduce your issue on a staging platform but not by doing flush/rsync but shutdown/rsync (yes I know it is not the same) and if it works I'm right and the problem is unsafe rsync of live files (as flush tables does not leave tables in consistent state as innodb continues to write to those files after flush) but if you reproduce the problem with shutdown then there's something else wrong and we should revisit the problem kind regards Bogdan
[6 Apr 2018 14:22]
Andrea Dante Bozzola
Thank you, we will try the solution you propose asap
[20 Apr 2018 7:50]
Andrea Dante Bozzola
Shutting down the donor instance works. One question, in case we cannot afford to shutdown the instance, can tablespace copy be a viable solution?
[20 Apr 2018 11:46]
MySQL Verification Team
Hi, I don't see a reason why not attm but can't confirm 100% as I never tried that myself. It's not a documented procedure for now but should work all best Bogdan