Bug #84371 Missing documentation for backup/recover when using MySQL Group Replication
Submitted: 29 Dec 2016 19:14 Modified: 5 Feb 2020 15:52
Reporter: Ted Wennmark Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7.17 OS:Any
Assigned to: CPU Architecture:Any

[29 Dec 2016 19:14] Ted Wennmark
Description:
I'm missing documentation on how to handle backup and recovery when using group replication.

Normal mysqldump command (--single-transaction) for InnoDB does not work due to group replication not supporting savepoints. This is mentioned in Bug Bug #81494 here: https://bugs.mysql.com/bug.php?id=81494.

Would like to have step-by-step procedure for doing backup/recover using:
- mysqldump
- mysqlpump
- MySQL Enterprise Backup (any limitation due to MEB using CSV engine for reporting/progress?)

How to repeat:
N/A

Suggested fix:
Create step-by-step guide to handle backup/recovery when using Group Replication, please also specify limitations with different solutions.

When running Group Replication in Single-Primary mode you can run mysqldump on one of the secondary read-only nodes and lock-all-tables like:
mysqldump -uuser -ppassword --hex-blob --flush-privileges --triggers --routines --events --master-data=2  --lock-all-tables -A  > dump.sql

Another options is to bring one of the nodes out of the group and set transaction-write-set-extraction=OFF and run your normal mysqldump command.

Recovery:
1) Import dump file: mysql -uroot -S./mysql1/my.sock < dump.sql 
2) mysql> reset master;
3) mysql> SET @@GLOBAL.GTID_PURGED='08.....:1-101434, 628.....:1';
   (use GTID_PURGED command from dump file)
4) mysql> START GROUP_REPLICATION;
5) Check node joins group and is ONLINE again: mysql> SELECT * FROM performance_schema.replication_group_members\G
[30 Dec 2016 3:22] MySQL Verification Team
Hello Ted,

Thank you for the report and feedback!

Thanks,
Umesh
[16 May 2019 16:50] Margaret Fisher
Posted by developer:
 
Thanks for submitting this, sorry you didn't get a response before.
Savepoints are now supported for mysqldump (see Bug #25331754 MYSQLDUMP CAN'T GET ALL DATABASES BACKUP WITH GROUP REPLICATION, MySQL Bug: 81494) so the regular procedure can be followed. I have closed off that bug.
Also documentation has now been added by Daniel So for MySQL Enterprise Backup with Group Replication 
(see https://dev.mysql.com/doc/refman/8.0/en/group-replication-enterprise-backup.html ).
So I think we are all good here now. Passing over to Daniel to close off.
[4 Jun 2019 14:22] Daniel So
Posted by developer:
 
Closing this bug as "rejected," as per Margaret Fisher's comment above.