pt-heartbeat --utc --check always returns 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Daniel Nichter | ||
2.1 |
Fix Released
|
Medium
|
Daniel Nichter | ||
2.2 |
Fix Released
|
Medium
|
Daniel Nichter |
Bug Description
I'm trying to use pt-heartbeat 2.2 with the new --utc option since the servers have different timezones. When running on the slave, pt-heartbeat --check always prints out "0", no matter how old the timestamp is in the heartbeat table.
I'm setting this on the master with:
/usr/bin/
Checking on the slave with:
/usr/bin/
After setting it on the master, running on the slave gives this:
# /usr/bin/
0
Even after waiting a few minutes, the result is the same. I can verify that the timestamp is set properly on the master by setting it manually, and switching to the slave:
# date -u && mysql -e "select ts from heartbeat\G" heartbeat
Tue Apr 2 15:08:36 UTC 2013
*******
ts: 2013-04-02 15:08:35
To get more information, I set PTDEBUG and ran pt-heartbeat again on master to update, and then the check outputs the following (truncated) debug info:
# TableParser:2872 2817 Storage engine: InnoDB
# TableParser:2726 2817 Table cols: `id`, `ts`
# TableParser:2872 2817 Storage engine: InnoDB
# TableParser:2888 2817 Parsed key: PRIMARY KEY (`id`)
# TableParser:2908 2817 PRIMARY key cols: `id`
# TableParser:2930 2817 This key is the clustered key
# pt_heartbeat:4886 2817 Hi-res ts: no
# pt_heartbeat:4951 2817 Heartbeat row primary key: id = 1
# pt_heartbeat:4957 2817 SELECT 1 FROM `heartbeat`
# pt_heartbeat:5097 2817 SELECT SQL: SELECT UNIX_TIMESTAMP(
# pt_heartbeat:5104 2817 SELECT UNIX_TIMESTAMP(
# pt_heartbeat:5107 2817 Heartbeat from server undef
# now: 2013-04-
# ts: 1364929924
# skew: 0.5
# pt_heartbeat:5112 2817 Delay -14397.648988 on foo.bar.com
# pt_heartbeat:5153 2817 --check and exit
# pt_heartbeat:5296 2817 Checking slave delay
# pt_heartbeat:5336 2817 Checking slave D=heartbeat
# pt_heartbeat:5346 2817 Woke up at 2013-04-
# pt_heartbeat:5104 2817 SELECT UNIX_TIMESTAMP(
# pt_heartbeat:5107 2817 Heartbeat from server undef
# now: 2013-04-
# ts: 1364929924
# skew: 0.5
# pt_heartbeat:5112 2817 Delay -14396.999310 on foo.bar.com
0
# pt_heartbeat:5391 2817 Disconnecting
Note that the slave server is 4 hours behind UTC (US Eastern), so the delay in the debug info matches that pretty much exactly. Seems like the check isn't respecting --utc, and since the delay is negative, it prints out 0.
Related branches
- Daniel Nichter: Approve
-
Diff: 75 lines (+46/-1)2 files modifiedbin/pt-heartbeat (+8/-0)
t/pt-heartbeat/utc.t (+38/-1)
- Daniel Nichter: Approve
-
Diff: 75 lines (+46/-1)2 files modifiedbin/pt-heartbeat (+8/-0)
t/pt-heartbeat/utc.t (+38/-1)
summary: |
- pt-heartbeat 2.2.1 check always returns 0 + pt-heartbeat --utc --check always returns 0 |
tags: | added: tz wrong-output |
Forgot to mention, this is percona- toolkit- 2.2.1-2 on RHEL 5.9, MySQL 5.5.29