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
=== modified file 'doc/source/how-tos.rst'
--- doc/source/how-tos.rst 2012-11-19 02:09:59 +0000
+++ doc/source/how-tos.rst 2013-04-30 12:46:25 +0000
@@ -38,6 +38,7 @@
38 :maxdepth: 138 :maxdepth: 1
3939
40 howtos/setting_up_replication40 howtos/setting_up_replication
41 howtos/backup_verification
4142
42.. _aux-guides:43.. _aux-guides:
4344
4445
=== added file 'doc/source/howtos/backup_verification.rst'
--- doc/source/howtos/backup_verification.rst 1970-01-01 00:00:00 +0000
+++ doc/source/howtos/backup_verification.rst 2013-04-30 12:46:25 +0000
@@ -0,0 +1,73 @@
1.. _backup_verification:
2
3====================================================
4 Verifying Backups with replication and pt-checksum
5====================================================
6
7One 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.).
8
9Setting up the replication
10============================
11
12:ref:`replication_howto` guide provides a detailed instructions on how to take the backup and set up the replication.
13
14For 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.
15
16Using pt-table-checksum
17=========================
18
19This 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.
20
21After 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*: ::
22
23 $ wget percona.com/get/pt-table-checksum
24
25.. note::
26
27 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.
28
29After this command has been run, *pt-table-checksum* will be downloaded to your current working directory.
30
31Running 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: ::
32
33 $ ./pt-table-checksum
34 TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
35 04-30T11:31:50 0 0 633135 8 0 5.400 exampledb.aka_name
36 04-30T11:31:52 0 0 290859 1 0 2.692 exampledb.aka_title
37 Checksumming exampledb.user_info: 16% 02:27 remain
38 Checksumming exampledb.user_info: 34% 01:58 remain
39 Checksumming exampledb.user_info: 50% 01:29 remain
40 Checksumming exampledb.user_info: 68% 00:56 remain
41 Checksumming exampledb.user_info: 86% 00:24 remain
42 04-30T11:34:38 0 0 22187768 126 0 165.216 exampledb.user_info
43 04-30T11:38:09 0 0 0 1 0 0.033 mysql.time_zone_name
44 04-30T11:38:09 0 0 0 1 0 0.052 mysql.time_zone_transition
45 04-30T11:38:09 0 0 0 1 0 0.054 mysql.time_zone_transition_type
46 04-30T11:38:09 0 0 8 1 0 0.064 mysql.user
47
48If all the values in the ``DIFFS`` column are 0 that means that backup is consistent with the current setup.
49
50In 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: ::
51
52 mysql> grant usage on exampledb.* to exampledb@localhost identified by 'thisisnewpassword';
53
54If we run the *pt-table-checksum* now difference should be spotted ::
55
56 $ ./pt-table-checksum
57 TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
58 04-30T11:31:50 0 0 633135 8 0 5.400 exampledb.aka_name
59 04-30T11:31:52 0 0 290859 1 0 2.692 exampledb.aka_title
60 Checksumming exampledb.user_info: 16% 02:27 remain
61 Checksumming exampledb.user_info: 34% 01:58 remain
62 Checksumming exampledb.user_info: 50% 01:29 remain
63 Checksumming exampledb.user_info: 68% 00:56 remain
64 Checksumming exampledb.user_info: 86% 00:24 remain
65 04-30T11:34:38 0 0 22187768 126 0 165.216 exampledb.user_info
66 04-30T11:38:09 0 0 0 1 0 0.033 mysql.time_zone_name
67 04-30T11:38:09 0 0 0 1 0 0.052 mysql.time_zone_transition
68 04-30T11:38:09 0 0 0 1 0 0.054 mysql.time_zone_transition_type
69 04-30T11:38:09 1 0 8 1 0 0.064 mysql.user
70
71This output shows that slave and the replica aren't in consistent state and that the difference is in the ``mysql.user`` table.
72
73More 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