Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-536

LP #1004567: pt-heartbeat --update --replace causes duplicate key error

    Details

      Description

      **Reported in Launchpad by Mark W last update 10-08-2012 18:15:18

      I am using pt-heartbeat with MySQL that is configured in a HA setup.
      LoadBalancer(VIP)

      M1(RW)<--->M2(RW)

      ------+
      S1(R) S2(R)
      I am using pt-heartbeat version 1.0.1

      I send out a heartbeat every two minutes to the active writer via cron
      to the load balancer Virtual IP Address.

      */2 * * * * /usr/bin/pt-heartbeat D test --update --replace --create
      table -h LBVIP -P LBPORT --run-time 1

      When I do a failover I get duplicate key errors on the secondary
      master M2. On failback i get duplicate key error on Master M1.

      Last_Error: Error 'Duplicate entry '8806' for key 'PRIMARY'' on query.
      Default database: 'test'. Query: 'INSERT INTO `test`.`heartbeat`
      (server_id, ts) VALUES ('8806', NOW())'

      I am using the --update --replace options but i believe based on my
      replication errors that it is doing an insert not a replace.

      Am i hitting a bug with pt-heartbeat or do i have to change my method
      of sending heartbeat?

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lpjirasync lpjirasync (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: