php-mysql-replication icon indicating copy to clipboard operation
php-mysql-replication copied to clipboard

Error while resuming with GTID

Open antonprogz opened this issue 4 years ago • 7 comments

  • Operating System: Linux
  • PHP Version: 7.2
  • php-mysql-replication Version: <v6.0.0>
  • *mysql version 5.7.30 >

Steps required to reproduce the problem.

  1. Start replication with an executed gtid set provided using ConfigBuilder::withGtid($gtid_set). You should use an actual gtid set from your mysql master.

Expected Result.

  • Replication started from $gtid_set.

Actual Result.

  • Replication did not start. The following message appeared in the log:

The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. The GTID sets and the missing purged transactions are too long to print in this message. For more information, please see the master's error log or the manual for GTID_SUBTRACT.

I've checked master's binlog, it contains required gtid_set.

antonprogz avatar Jun 10 '20 00:06 antonprogz

hi

can you check

select @@GLOBAL.gtid_executed, @@GLOBAL.gtid_purged

Are you sure that this logs where not purged on master as this message shows ?

I will try to replicate this later but this is first what comes to my mind.

krowinski avatar Jun 10 '20 12:06 krowinski

The query

select @@GLOBAL.gtid_executed, @@GLOBAL.gtid_purged\G

resulted with:

*************************** 1. row ***************************
@@GLOBAL.gtid_executed: 4af0b40c-6f3c-11e7-ad89-001e673bb989:1-179974,
88fe7c40-5829-11ea-a714-525400d38027:1-3116017
  @@GLOBAL.gtid_purged: 4af0b40c-6f3c-11e7-ad89-001e673bb989:1-179974,
88fe7c40-5829-11ea-a714-525400d38027:1-2808255
1 row in set (0.00 sec)

The gtid set value passed to the library:

4af0b40c-6f3c-11e7-ad89-001e673bb989:1-179974,88fe7c40-5829-11ea-a714-525400d38027:1-3116017

antonprogz avatar Jun 15 '20 01:06 antonprogz

ok what shows you

show master status

?

column Executed_Gtid_Set

krowinski avatar Jun 18 '20 15:06 krowinski

The gtid set value passed to the library:

4af0b40c-6f3c-11e7-ad89-001e673bb989:1-179974,88fe7c40-5829-11ea-a714-525400d38027:1-3418495
mysql> select @@GLOBAL.gtid_executed, @@GLOBAL.gtid_purged\G
*************************** 1. row ***************************
@@GLOBAL.gtid_executed: 4af0b40c-6f3c-11e7-ad89-001e673bb989:1-179974,
88fe7c40-5829-11ea-a714-525400d38027:1-3418495
  @@GLOBAL.gtid_purged: 4af0b40c-6f3c-11e7-ad89-001e673bb989:1-179974,
88fe7c40-5829-11ea-a714-525400d38027:1-3093412
1 row in set (0.00 sec)
mysql> show master status;
+------------------+----------+--------------+------------------+-----------------------------------------------------------------------------------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                                                                             |
+------------------+----------+--------------+------------------+-----------------------------------------------------------------------------------------------+
| mysql-bin.000209 | 17357886 |              |                  | 4af0b40c-6f3c-11e7-ad89-001e673bb989:1-179974,
88fe7c40-5829-11ea-a714-525400d38027:1-3418495 |
+------------------+----------+--------------+------------------+-----------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

antonprogz avatar Jun 24 '20 23:06 antonprogz

the issue solved?i have the same problem 。php7.2 mysql 5.6

luyaotang avatar Nov 10 '21 16:11 luyaotang

Does this have any results? I also encountered

yaqianghan avatar Oct 08 '23 08:10 yaqianghan

@krowinski Does this have any results? I also encountered

yaqianghan avatar Oct 08 '23 08:10 yaqianghan