Merge lp://staging/~percona-toolkit-dev/percona-toolkit/ptc-errors-on-slave-with-different-time-zone-1388870 into lp://staging/~percona-toolkit-dev/percona-toolkit/release-2.2.13
Proposed by
Frank Cizmich
Status: | Merged |
---|---|
Approved by: | Frank Cizmich |
Approved revision: | 613 |
Merged at revision: | 621 |
Proposed branch: | lp://staging/~percona-toolkit-dev/percona-toolkit/ptc-errors-on-slave-with-different-time-zone-1388870 |
Merge into: | lp://staging/~percona-toolkit-dev/percona-toolkit/release-2.2.13 |
Diff against target: |
155 lines (+38/-13) 7 files modified
bin/pt-table-checksum (+3/-3) lib/RowChecksum.pm (+3/-3) t/lib/RowChecksum.t (+4/-4) t/pt-table-checksum/bugs.t (+25/-0) t/pt-table-checksum/samples/chunkidx004.txt (+1/-1) t/pt-table-checksum/samples/chunkidx005.txt (+1/-1) t/pt-table-checksum/samples/n-chunk-index-cols.txt (+1/-1) |
To merge this branch: | bzr merge lp://staging/~percona-toolkit-dev/percona-toolkit/ptc-errors-on-slave-with-different-time-zone-1388870 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Nichter | Needs Fixing | ||
Review via email: mp+245683@code.staging.launchpad.net |
Description of the change
Problem:
When a slave is in a server with a different system timezone, pt-table-checksum detects differences on timestamp type columns.
Solution:
Normalize the output of those columns using UNIX_TIMESTAMP
Notes:
- No difference in performance was detected. Docs say it is an extremely fast function.
- Tested manually. Creating a test case for this is near impossible since system tz is read-only on the database, and is lifted from the machine at startup.
To post a comment you must log in.
I think this is ok. The +0 was just a clever way to coerce a timestamp to a big int. UNIX_TIMESTAMP() does the same but avoids the tz problem. So the only thing this MP lacks is a test case. This should be possible because you can SET GLOBAL time_zone='+7:00' on a slave and then reproduce the problem. We should not get in habit of fixes without solid test cases.