8.20.3.3. trepctl check Command

The check command can be used to check a specific table or an entrie schema for data consistency.

trepctl check <schema>[.<table>] [ -limit ]

Table 8.34. trepctl check Options

OptionDescription
-limitSpecify the x,y limits for the check to execute. Results in the use of the standard MySQL LIMIT x,y DML syntax. For example -limit 0,100 will scan the first 100 records. Data checks in order based on primary key.

The command should be issued on the primary node, which results in data being written to the CONSISTENCY table within the replication configuration schema.

This is then replicated to the replica nodes and the check is automatically triggered, which results in the corresponding rows being updated.

You can then query the table to compare the checksums, additionally if a mismatch is found the replicator will be placed into the OFFLINE:ERROR state.

For large tables, you can specify the -limit option to execute the check on smaller subsets of data.

Warning

Executing trepctl check places a LOCK IN SHARE MODE on the table/data for the duration of the check. This will prevent data changes but will continue to allow data to be read.

Warning

Because the check operation is creating a temporary table containing a CRC of each row within the specified schema or specific table, the size of the temporary table created can be quite large as it consists of CRC and row count information for each row of each table (within the specified row limits). The configured directory used by MySQL for temporary table creation will need a suitable amount of space to hold the temporary data.