From ee758c6f3133e5146e25d8ba41571a28bc3c8be7 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Fri, 28 Jun 2013 11:11:35 -0700 Subject: [PATCH] Fix docs to account for --utc. --- bin/pt-heartbeat | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 401c3cd9..3ebc3b0d 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -5688,6 +5688,10 @@ be created with the following MAGIC_create_heartbeat table definition: The heartbeat table requires at least one row. If you manually create the heartbeat table, then you must insert a row by doing: + INSERT INTO heartbeat (ts, server_id) VALUES (NOW(), N); + +or if using L<"--utc">: + INSERT INTO heartbeat (ts, server_id) VALUES (UTC_TIMESTAMP(), N); where C is the server's ID; do not use @@server_id because it will replicate @@ -5706,6 +5710,10 @@ Legacy tables do not support L<"--update"> instances on each slave of a multi-slave hierarchy like "master -> slave1 -> slave2". To manually insert the one required row into a legacy table: + INSERT INTO heartbeat (id, ts) VALUES (1, NOW()); + +or if using L<"--utc">: + INSERT INTO heartbeat (id, ts) VALUES (1, UTC_TIMESTAMP()); The tool automatically detects if the heartbeat table is legacy. @@ -6003,9 +6011,14 @@ 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, but it also makes the tool backwards-incompatible with -pt-heartbeat 2.2.3 and older (unless the older version of pt-heartbeat -is running on a system that uses UTC). +time zones. + +If used, this option must be used for all pt-heartbeat instances: +L<"--update">, L<"--monitor">, L<"--check">, etc. You should probably +set the option in a L<"--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). =item --version