Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28770

replication duplicate key with the slave_pos

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.4.18
    • Fix Version/s: None
    • Component/s: Replication
    • Labels:
    • Environment:
      master slave

      Description

      Hi guys
      when use the slave_pos to recover an crashed master slave,like below.
      CHANGE MASTER TO MASTER_HOST=\'172.137.254.21\', MASTER_PORT=3306, MASTER_USER=\'replication\', MASTER_PASSWORD=*****, MASTER_USE_GTID=slave_pos'

      found that the replication will start from a wrong position,although the position in the log is right,but actually it will start from a wrong pos and try apply the transaction that already exists in the database.
      /////////////////////////
      2022-06-08 10:58:45 1105456 [Note] Slave I/O thread: connected to master 'replication@172.137.254.21:3306',replication starts at GTID position '111-11-5933'
      2022-06-08 10:58:45 1105457 [ERROR] Slave SQL: Could not execute Write_rows_v1 event on table tt.table1; Duplicate entry '5575-2021-12-30 00:00:00-m1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log BINLOG.000001, end_log_pos 1880831, Internal MariaDB error code: 1062
      2022-06-08 10:58:45 1105457 [Warning] Slave: Duplicate entry '5575-2021-12-30 00:00:00-m1' for key 'PRIMARY' Error_code: 1062
      //////////////////////////////

      is this a bug?could you help on this?

        Attachments

        1. binlog
          2 kB
        2. my.cnf.1
          5 kB
        3. scripts
          6 kB

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            yongjian.wu yongjian.wu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.