pt-heartbeat reports a wrong result when in different timezone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Ran command below,
# pt-heartbeat --defaults-
10800.00
and SHOW SLAVE STATUS shows,
mysql> show slave status \G
*******
Slave_IO_State: Waiting for master to send event
Master_Host: 162.254.24.244
Master_User: replication
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000757
Read_Master_
Relay_Log_File: relay-bin.002018
Relay_Log_Pos: 451959067
Relay_Master_
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_
Replicate_Do_Table:
Replicate_
Replicate_
Replicate_
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_
Relay_Log_Space: 451959217
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_
Master_
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_
Master_Server_Id: 3
1 row in set (0.00 sec)
Timezones:
they report the same time, but in different time zones
slave: Fri Jul 4 22:48:23 EDT 2014
master: Fri Jul 4 19:48:31 PDT 2014
After changing the timezones:
master Fri Jul 4 20:07:48 PDT 2014
slave Fri Jul 4 20:07:39 PDT 2014
# pt-heartbeat --defaults-
0.00
Solution: pt-hearbeat might be able to detect if the timezone are different against each other, else provide a workaround or could also be a warning regarding this issue.
tags: | added: pt-heartbeat |
Hello Paul,
pt-hearbeat has an option for this.
From the docs:
======= ======= ======
--utc
Ignore system time zones and use only UTC. By default pt-heartbeat does not check or adjust for different system or MySQL time zones which can cause the tool to compute the lag incorrectly. Specifying this option is a good idea because it ensures that the tool works correctly regardless of time zones.
If used, this option must be used for all pt-heartbeat instances: --update, --monitor, --check, etc. You should probably set the option in a --config file. Mixing this option with pt-heartbeat instances not using this option will cause false-positive lag readings due to different time zones (unless all your systems are set to use UTC, in which case this option isn’t required). ======= ======
=======