Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

When upstream has gap in GTID sets, switching enable-gtid from OFF to ON will fail the synchronization #1814

Closed
glkappe opened this issue Jun 24, 2021 · 2 comments · Fixed by #2094
Labels
affected-v2.0.4 this issue/BUG affects v2.0.4 affected-v2.0.5 this issue/BUG affects v2.0.5 affected-v2.0.6 this issue/BUG affects v2.0.6 severity/minor type/bug This issue is a bug report

Comments

@glkappe
Copy link

glkappe commented Jun 24, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
    dm worker error log:
    image
    mysql binlog info:
    image

query-status 03 syncerbinloggtid info:
"unresolvedDDLLockID": "", "sync": { "totalEvents": "0", "totalTps": "0", "recentTps": "0", "masterBinlog": "(mysql-bin.074545, 417140060)", "masterBinlogGtid": "148da50a-935f-11ea-9456-0ecb2cc2c6f2:1-26025771647,5ba91a4e-2b16-11eb-8406-0af8ee284d60:1-43991284520,903b8ce1-9357-11ea-a7af-0eac1754e2d4:1-7,f5cdfc8b-2b15-11eb-ba43-0a342fdb5c6c:1-21093139382", "syncerBinlog": "(mysql-bin.074534, 999293514)", "syncerBinlogGtid": "148da50a-935f-11ea-9456-0ecb2cc2c6f2:23174871189-26025771647,5ba91a4e-2b16-11eb-8406-0af8ee284d60:1-43991284520,f5cdfc8b-2b15-11eb-ba43-0a342fdb5c6c:1-21082962932",
mysql binlog 74534 :
image

mysql master status & purged info:
image

  1. What did you expect to see?
    replication is stop, and error is 'gtid is purged'

  2. What did you see instead?
    task is running

  3. Versions of the cluster

    • DM version (run dmctl -V or dm-worker -V or dm-master -V):
      v2.0.4

      (paste DM version here, and you must ensure versions of dmctl, DM-worker and DM-master are same)
      
    • Upstream MySQL/MariaDB server version:
      5.7-percona

      (paste upstream MySQL/MariaDB server version here)
      
    • Downstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):
      v4.0.10

      (paste TiDB cluster version here)
      
    • How did you deploy DM: DM-Ansible or manually?
      tiup

      (leave DM-Ansible or manually here)
      
    • Other interesting information (system version, hardware config, etc):

      centos 7

  4. current status of DM cluster (execute query-status in dmctl)
    task 3 is paused

  5. Operation logs

    • Please upload dm-worker.log for every DM-worker instance if possible
    • Please upload dm-master.log if possible
    • Other interesting logs
    • Output of dmctl's commands with problems
  6. Configuration of the cluster and the task

    • dm-worker.toml for every DM-worker instance if possible
    • dm-master.toml for DM-master if possible
    • task config, like task.yaml if possible
    • inventory.ini if deployed by DM-Ansible
      add enable-gtid: true to 3source file
  7. Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus for DM if possible
    no

@lichunzhu
Copy link
Contributor

This problem is caused by previous gtid sets may not include all purged gtid sets. MySQL reported an error when we request a purged GTID.

@glorv glorv added affected-v2.0.4 this issue/BUG affects v2.0.4 type/bug This issue is a bug report labels Jun 25, 2021
@lance6716 lance6716 changed the title v2.0.4 - binlog file & pos mode automatically switch to gtid mode, possible problems When upstream has gap in GTID sets, switching enable-gtid from OFF to ON will fail the synchronization Jun 29, 2021
@lance6716
Copy link
Collaborator

maybe we could use select @@global.gtid_executed; to get a no gap GTID, will test later

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-v2.0.4 this issue/BUG affects v2.0.4 affected-v2.0.5 this issue/BUG affects v2.0.5 affected-v2.0.6 this issue/BUG affects v2.0.6 severity/minor type/bug This issue is a bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants