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

LP #1099665: pt-heartbeat 2.1.8 reports big time drift with UTC_TIMESTAMP

    XMLWordPrintable

    Details

      Description

      **Reported in Launchpad by Jervin R last update 15-02-2013 17:10:59

      I just noticed pt-heartbeat is now using UTC_TIMESTAMP with the check/monitor query, for updates by older version and check by 2.1.8 or vice versa, there will be a large time delay reported. See a snippet of debug output below:

      This is 2.1.8:

      1. $DBD::mysql::VERSION: 4.013 $DBI::VERSION: 1.609
      2. pt_heartbeat:4904 16322 Heartbeat row primary key: server_id = 1
      3. pt_heartbeat:4910 16322 SELECT 1 FROM `test`.`heartbeat` WHERE server_id='1' LIMIT 1
      4. pt_heartbeat:5048 16322 SELECT SQL: SELECT UNIX_TIMESTAMP(UTC_TIMESTAMP()), UNIX_TIMESTAMP(ts)/!50038, @@hostname AS host/, server_id FROM `test`.`heartbeat` WHERE server_id='1' LIMIT 1
      5. pt_heartbeat:5055 16322 SELECT UNIX_TIMESTAMP(UTC_TIMESTAMP()), UNIX_TIMESTAMP(ts)/!50038, @@hostname AS host/, server_id FROM `test`.`heartbeat` WHERE server_id='1' LIMIT 1
      6. pt_heartbeat:5057 16322 Heartbeat from server 1
      7. now: 1358235876
      8. ts: 1358217876
      9. skew: 0.5
      10. pt_heartbeat:5062 16322 Delay 17999.500000 on forge.dotmanila.com
      11. pt_heartbeat:5103 16322 --check and exit
      12. pt_heartbeat:5234 16322 Checking slave delay
      13. pt_heartbeat:5274 16322 Checking slave D=test,S=/tmp/mysql_sandbox5091.sock,h=localhost,p=...,u=msandbox
      14. pt_heartbeat:5284 16322 Woke up at 2013-01-14T21:44:37.501070
      15. pt_heartbeat:5055 16322 SELECT UNIX_TIMESTAMP(UTC_TIMESTAMP()), UNIX_TIMESTAMP(ts)/!50038, @@hostname AS host/, server_id FROM `test`.`heartbeat` WHERE server_id='1' LIMIT 1
      16. pt_heartbeat:5057 16322 Heartbeat from server 1
      17. now: 1358235877
      18. ts: 1358217877
      19. skew: 0.5
      20. pt_heartbeat:5062 16322 Delay 17999.500000 on forge.dotmanila.com
        17999.50
      21. pt_heartbeat:5329 16322 Disconnecting

      This is 2.1.7

      1. $DBD::mysql::VERSION: 4.013 $DBI::VERSION: 1.609
      2. pt_heartbeat:4822 16328 Heartbeat row primary key: server_id = 1
      3. pt_heartbeat:4828 16328 SELECT 1 FROM `test`.`heartbeat` WHERE server_id='1' LIMIT 1
      4. pt_heartbeat:4940 16328 SELECT SQL: SELECT ts/!50038, @@hostname AS host/, server_id FROM `test`.`heartbeat` WHERE server_id='1' LIMIT 1
      5. pt_heartbeat:4947 16328 SELECT ts/!50038, @@hostname AS host/, server_id FROM `test`.`heartbeat` WHERE server_id='1' LIMIT 1
      6. pt_heartbeat:4950 16328 Heartbeat from server 1
      7. now: 2013-01-14T21:45:28.657450
      8. ts: 2013-01-14T21:45:28.000600
      9. skew: 0.5
      10. pt_heartbeat:4955 16328 Delay 0.156854 on forge.dotmanila.com
      11. pt_heartbeat:4996 16328 --check and exit
      12. pt_heartbeat:5127 16328 Checking slave delay
      13. pt_heartbeat:5167 16328 Checking slave D=test,S=/tmp/mysql_sandbox5091.sock,h=localhost,p=...,u=msandbox
      14. pt_heartbeat:5177 16328 Woke up at 2013-01-14T21:45:29.500810
      15. pt_heartbeat:4947 16328 SELECT ts/!50038, @@hostname AS host/, server_id FROM `test`.`heartbeat` WHERE server_id='1' LIMIT 1
      16. pt_heartbeat:4950 16328 Heartbeat from server 1
      17. now: 2013-01-14T21:45:29.501140
      18. ts: 2013-01-14T21:45:29.001320
      19. skew: 0.5
      20. pt_heartbeat:4955 16328 Delay -0.000180 on forge.dotmanila.com
        0.00
      21. pt_heartbeat:5222 16328 Disconnecting

      This should at least be documented if not made aware of the ts offset that generated the ts on the master.

        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: