Details
-
Improvement
-
Status: Done
-
Medium
-
Resolution: Fixed
-
3.0.3
-
None
Description
There are 2 cases where a checksum table can be left with stale data:
- a table was previously checksummed and has since been dropped
- a table/schema is filtered out from replication, but was previously replicated and checksummed
Currently, the tool will:
- delete rows by default for any table that it comes across
- create a checksum table by default if none exists
Unless resume or noempty-replicate-table are specified, stale data is not expected to be present and both of these are optional and disabled by default.
Feature: Enable pt-table-checksum to completely purge the --replicate table Scenario: Purge all data ahead of a new checksum Given --resume and --noempty-replicate-table are disabled And --truncate-replicate-table is enabled When running a checksum Then the --replicate table is emptied ahead of starting a new checksum (either truncate or a swap-and-drop) Scenario: Purge all data ahead of a new checksum Given --empty-replicate-table is enabled And --truncate-replicate-table is enabled When running a checksum Then the --truncate-replicate-table takes precedence Scenario: Conflicting configuration Given --truncate-replicate-table is enabled And --resume or --noempty-replicate-table are enabled When running a checksum Then produce an error for the user to change configuration
This would maintain existing behaviour whilst allowing for configuration to be set by default for those that wish to use it. However, there could be a misunderstanding by a user about what --empty-replicate-table actually does and they think that the table is indeed emptied when it isn't