Selivanov Pavel
Selivanov Pavel

Reputation: 360

xtrabackup does not write gtid information in xtrabackup_binlog_info

Software versions:

xtrabackup 8.0.12
percona-xtradb-cluster-server 8.0.18-9

I am running xtrabackup with this options:

--defaults-file=/etc/mysql/my.cnf --backup --user=backup
--password=**** --parallel=4 --no-timestamp --target-dir=/my-backup-dir

Some of server options:

binlog_format | ROW
gtid_mode     | ON_PERMISSIVE
enforce_gtid_consistency | ON

File xtrabackup_binlog_info has only binlog file name and position:

mysql-bin.000159        251

No GTID, so I can not create GTID-based replication restoring a slave from this backup.

What should I do to make xtrabackup include this information?

UPDATE:

Check if GTIDs are enabled:

show global variables like '%gtid%';

| Variable_name                    | Value                                                                                                           |
| binlog_gtid_simple_recovery      | ON                                                                                                              |
| enforce_gtid_consistency         | ON                                                                                                              |
| gtid_executed                    | c0e3de06-a2a6-11ea-913c-c7b046cf5782:1-3399594,
de211648-2642-ee18-628d-dc48283b005c:1-3697598:3877279-10141440 |
| gtid_executed_compression_period | 1000                                                                                                            |
| gtid_mode                        | ON_PERMISSIVE                                                                                                   |
| gtid_owned                       |                                                                                                                 |
| gtid_purged                      | c0e3de06-a2a6-11ea-913c-c7b046cf5782:1-2661056,
de211648-2642-ee18-628d-dc48283b005c:1-3697598:3877279-10141440 |
| session_track_gtids              | OFF                                                                                                             |
show master status;

| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                                                                                               |
| mysql-bin.000166 | 15285372 |              |                  | c0e3de06-a2a6-11ea-913c-c7b046cf5782:1-3358798,
de211648-2642-ee18-628d-dc48283b005c:1-3697598:3877279-10141440 |

(pavel.selivanov@localhost) [kassa_prod]> show binlog events in 'mysql-bin.000166' limit 7;

| Log_name         | Pos  | Event_type     | Server_id | End_log_pos | Info
| mysql-bin.000166 |    4 | Format_desc    |      4315 |         124 | Server ver: 8.0.18-9, Binlog ver: 4                                                                           |
| mysql-bin.000166 |  124 | Previous_gtids |      4315 |         251 | c0e3de06-a2a6-11ea-913c-c7b046cf5782:1-3347159,
de211648-2642-ee18-628d-dc48283b005c:3697598:3877279-10141440 |
| mysql-bin.000166 |  251 | Gtid           |      4315 |         330 | SET @@SESSION.GTID_NEXT= 'c0e3de06-a2a6-11ea-913c-c7b046cf5782:3347160'                                       |
| mysql-bin.000166 |  330 | Query          |      4315 |         411 | BEGIN                                                                                                         |
| mysql-bin.000166 |  411 | Table_map      |      4315 |         499 | table_id: 150 (db.table)                                                                      |
| mysql-bin.000166 |  499 | Update_rows    |      4315 |        3475 | table_id: 150 flags: STMT_END_F                                                                               |
| mysql-bin.000166 | 3475 | Xid            |      4315 |        3506 | COMMIT /* xid=9611331 */                                                          

Upvotes: 0

Views: 972

Answers (1)

fancyPants
fancyPants

Reputation: 51868

From the manual:

  • ON_PERMISSIVE: New transactions are GTID transactions. Replicated transactions can be either anonymous or GTID transactions.

Check with show global variables like 'gt%'; or in your binary logs, if you actually have GTID transactions.

You actually don't have anything special to do, to have xtrabackup include GTIDs in the xtrabackup_binlog_info file: How to create a new (or repair a broken) GTID based slave

Upvotes: 0

Related Questions