Merge lp:~hrvojem/percona-xtrabackup/bug1158243-2.0 into lp:percona-xtrabackup/2.0

Proposed by Hrvoje Matijakovic
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 551
Proposed branch: lp:~hrvojem/percona-xtrabackup/bug1158243-2.0
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 89 lines (+74/-0)
2 files modified
doc/source/how-tos.rst (+1/-0)
doc/source/howtos/backup_verification.rst (+73/-0)
To merge this branch: bzr merge lp:~hrvojem/percona-xtrabackup/bug1158243-2.0
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+161587@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

  - s/One of the ways how to verify/One way to verify/ would probably be
    a better wording (with the "I am not a native speaker" disclaimer
    attached)
  - would linking to
    http://www.percona.com/doc/percona-toolkit/pt-table-checksum.html
    (i.e. excluding the version) be better, so it redirects to the
    latest version docs at all times?
  - I would clarify that the master replication server in this recipe
    may be either the original server where the backup was taken, or
    another test server created by using a different backup method (such
    as cold backup, mysqldump or LVM snapshots) at the original server.

review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve
Revision history for this message
Stewart Smith (stewart) wrote :

Alexey Kopytov <email address hidden> writes:
> Review: Needs Fixing
>
> - s/One of the ways how to verify/One way to verify/ would probably be
> a better wording (with the "I am not a native speaker" disclaimer
> attached)

With the "I am a native speaker" disclaimer: it is better wording :)

--
Stewart Smith

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/source/how-tos.rst'
2--- doc/source/how-tos.rst 2012-11-19 02:09:59 +0000
3+++ doc/source/how-tos.rst 2013-04-30 12:46:25 +0000
4@@ -38,6 +38,7 @@
5 :maxdepth: 1
6
7 howtos/setting_up_replication
8+ howtos/backup_verification
9
10 .. _aux-guides:
11
12
13=== added file 'doc/source/howtos/backup_verification.rst'
14--- doc/source/howtos/backup_verification.rst 1970-01-01 00:00:00 +0000
15+++ doc/source/howtos/backup_verification.rst 2013-04-30 12:46:25 +0000
16@@ -0,0 +1,73 @@
17+.. _backup_verification:
18+
19+====================================================
20+ Verifying Backups with replication and pt-checksum
21+====================================================
22+
23+One way to verify if the backup is consistent is by setting up the replication and running `pt-table-checksum <http://www.percona.com/doc/percona-toolkit/pt-table-checksum.html>`_. This can be used to verify any type of backups, but before setting up replication, backup should be prepared and be able to run (this means that incremental backups should be merged to full backups, encrypted backups decrypted etc.).
24+
25+Setting up the replication
26+============================
27+
28+:ref:`replication_howto` guide provides a detailed instructions on how to take the backup and set up the replication.
29+
30+For checking the backup consistency you can use either the original server where the backup was taken, or another test server created by using a different backup method (such as cold backup, mysqldump or LVM snapshots) as the master server in the replication setup.
31+
32+Using pt-table-checksum
33+=========================
34+
35+This tool is part of the |Percona Toolkit|. It performs an online replication consistency check by executing checksum queries on the master, which produces different results on replicas that are inconsistent with the master.
36+
37+After you confirmed that replication has been set up successfully, you can `install <http://www.percona.com/doc/percona-toolkit/installation.html>`_ or download *pt-table-checksum*. This example shows downloading the latest version of *pt-table-checksum*: ::
38+
39+ $ wget percona.com/get/pt-table-checksum
40+
41+.. note::
42+
43+ In order for pt-table-checksum to work correctly ``libdbd-mysql-perl`` will need to be installed on *Debian/Ubuntu* systems or ``perl-DBD-MySQL`` on *RHEL/CentOS*. If you installed the *percona-toolkit* package from the Percona repositories package manager should install those libraries automatically.
44+
45+After this command has been run, *pt-table-checksum* will be downloaded to your current working directory.
46+
47+Running the *pt-table-checksum* on the master will create ``percona`` database with the ``checksums`` table which will be replicated to the slaves as well. Example of the *pt-table-checksum* will look like this: ::
48+
49+ $ ./pt-table-checksum
50+ TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
51+ 04-30T11:31:50 0 0 633135 8 0 5.400 exampledb.aka_name
52+ 04-30T11:31:52 0 0 290859 1 0 2.692 exampledb.aka_title
53+ Checksumming exampledb.user_info: 16% 02:27 remain
54+ Checksumming exampledb.user_info: 34% 01:58 remain
55+ Checksumming exampledb.user_info: 50% 01:29 remain
56+ Checksumming exampledb.user_info: 68% 00:56 remain
57+ Checksumming exampledb.user_info: 86% 00:24 remain
58+ 04-30T11:34:38 0 0 22187768 126 0 165.216 exampledb.user_info
59+ 04-30T11:38:09 0 0 0 1 0 0.033 mysql.time_zone_name
60+ 04-30T11:38:09 0 0 0 1 0 0.052 mysql.time_zone_transition
61+ 04-30T11:38:09 0 0 0 1 0 0.054 mysql.time_zone_transition_type
62+ 04-30T11:38:09 0 0 8 1 0 0.064 mysql.user
63+
64+If all the values in the ``DIFFS`` column are 0 that means that backup is consistent with the current setup.
65+
66+In case backup wasn't consistent *pt-table-checksum* should spot the difference and point to the table that doesn't match. Following example shows adding new user on the backed up slave in order to simulate the inconsistent backup: ::
67+
68+ mysql> grant usage on exampledb.* to exampledb@localhost identified by 'thisisnewpassword';
69+
70+If we run the *pt-table-checksum* now difference should be spotted ::
71+
72+ $ ./pt-table-checksum
73+ TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
74+ 04-30T11:31:50 0 0 633135 8 0 5.400 exampledb.aka_name
75+ 04-30T11:31:52 0 0 290859 1 0 2.692 exampledb.aka_title
76+ Checksumming exampledb.user_info: 16% 02:27 remain
77+ Checksumming exampledb.user_info: 34% 01:58 remain
78+ Checksumming exampledb.user_info: 50% 01:29 remain
79+ Checksumming exampledb.user_info: 68% 00:56 remain
80+ Checksumming exampledb.user_info: 86% 00:24 remain
81+ 04-30T11:34:38 0 0 22187768 126 0 165.216 exampledb.user_info
82+ 04-30T11:38:09 0 0 0 1 0 0.033 mysql.time_zone_name
83+ 04-30T11:38:09 0 0 0 1 0 0.052 mysql.time_zone_transition
84+ 04-30T11:38:09 0 0 0 1 0 0.054 mysql.time_zone_transition_type
85+ 04-30T11:38:09 1 0 8 1 0 0.064 mysql.user
86+
87+This output shows that slave and the replica aren't in consistent state and that the difference is in the ``mysql.user`` table.
88+
89+More information on different options that pt-table-checksum provides can be found in the *pt-table-checksum* `documentation <http://www.percona.com/doc/percona-toolkit/2.2/pt-table-checksum.html>`_.

Subscribers

People subscribed via source and target branches