-
Notifications
You must be signed in to change notification settings - Fork 188
syncer: fix the gtid purged error when switching pos replication to gtid #2094
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
1 similar comment
/run-all-tests |
/run-all-tests unstable-test: https://ci.pingcap.net/blue/organizations/jenkins/dm_ghpr_new_test/detail/dm_ghpr_new_test/2234/pipeline/ |
/run-all-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 865e978
|
In response to a cherrypick label: new pull request created: #2104. |
What problem does this PR solve?
Fix #1814
In #1723 we support switching position replication to gtid replication by combining previous GTID sets and their events in binlog files. However, if there are some gtid events that are purged, the switching progress will fail.
What is changed and how it works?
According to MySQL's official document 1
and MySQL's official document 2
Gsets of
gtid_purged
are not in any binlog files but they are contained ingtid_executed
. This can explain two things:gtid_purged
, even if we continue the way of position replication.gtid_executed
won't make the situation better. Upstream MySQL may still purge binlogs when we trying to catch events togtid_executed
.So we can directly add
gtid_purged
in adjusted gtid sets to avoid MySQL error.Check List
Tests
Use a slave MySQL whose previous gtids starts from 5 to test whether this PR works.
Related changes