

For example, if theĭatabase administrator needs to kill pt-table-checksum‘s queries for any reason, Thus, pt-table-checksum is very resilient to errors. However, a tool that must be restarted constantly is difficult to You should probably set a sane value for your server with theĬhecksumming usually is a low-priority task that should yield to other work on Pt-table-checksum will pause if there are more than 25 concurrently executing
#CHECKSUM TOOL HOW TO#
There is no single right answer for how to do this, but by default Wait, it will be the victim instead of causing other queries to time out.Īnother safeguard checks the load on the database server, and pauses if the load Session-level innodb_lock_wait_timeout to 1 second, so that if there is a lock Which causes a very long delay in replication. This avoids the following scenario: a table is empty on the masterīut is very large on a replica, and is checksummed in a single large query, Pt-table-checksum additionally verifies that the table isn’t oversized on If a table will beĬhecksummed in a single chunk because it has a small number of rows, then Safeguard with the -chunk-size-limit option. You can configure the sensitivity of this Performs an EXPLAIN query on each chunk, and skips chunks that might be larger Pt-table-checksum verifies that chunks are not too large to checksum safely. Potentially conflict with them and cause replication to fail. Replicationįilters are dangerous, because the queries that pt-table-checksum executes could Replication filters, and refuses to operate unless you force it to. InĪddition, pt-table-checksum looks for common causes of problems, such as Has an error, or replication stops, pt-table-checksum pauses and waits. Replication, pt-table-checksum pauses to allow it to catch up.

(If thisįails, you can give it a hint with the -recursion-method option.) Pt-table-checksum detects replicas and connects to them automatically. With any server’s operation, including replicas. Pt-table-checksum has many other safeguards to ensure that it does not interfere Rows, the tool will checksum the table in a single chunk. If there is no index, and the table contains a suitably small number of Table into chunks is an index of some sort (preferably a primary key or unique Pt-table-checksum are removed, because they did not result in predictably sizedĬhunks, and didn’t work well on many tables. The legacy chunking algorithms used in older versions of It is the same technique used for pt-archiver, forĮxample. Server becomes heavily loaded during a traffic spike or a background task, forĬhunking is accomplished by a technique that we used to call “nibbling” in other This means that the tool will quickly throttle itself if your Yet remain responsive if the server’s performance changes during checksummingįor any reason. Uses an exponentially decaying weighted average to keep the chunk size stable, The tool keeps track of how quickly the server is able to execute the queries,Īnd adjusts the chunks as it learns more about the server’s performance. Too much replication lag or load on the server. Single big query, is to ensure that checksums are unintrusive and don’t cause The goal of chunking the tables, instead of doing each table with a It varies the chunk size to make the checksum queries run in the desired amount One reason it can work on very large tables is that it divides each table intoĬhunks of rows, and checksums each chunk with a single REPLACE.SELECT query. No matter how large the server is, pt-table-checksum works Have used it on servers with hundreds of thousands of databases and tables, and This makes it usable on very large servers. Time, so it does not accumulate large amounts of memory or do a lot of workīefore beginning to checksum. Tables that match the filters you specify (if any). Pt-table-checksum connects to the server you specify, and finds databases and

If you need the olderīehavior, you can use Percona Toolkit version 1.0. These flow through replication to re-execute on replicas. It executes checksum queries on only one server, and Single purpose, and does not have a lot of complexity or support many differentĬhecksumming techniques. In contrast to older versions of pt-table-checksum, this tool is focused on a The following is a high-level overview of how the tool functions. When in doubt, use -explain to see how the tool will checksum a Pt-table-checksum is designed to do the right thing by default in almost everyĬase. Percona Advanced Managed Database Service
