Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-173

Enable pt-table-checksum to ensure stale data is removed

Details

    • Improvement
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 3.0.3
    • 3.0.4
    • None

    Description

      There are 2 cases where a checksum table can be left with stale data:

      1. a table was previously checksummed and has since been dropped
      2. a table/schema is filtered out from replication, but was previously replicated and checksummed

      Currently, the tool will:

      1. delete rows by default for any table that it comes across
      2. 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

      Attachments

        Activity

          People

            carlos.salguero Carlos Salguero (Inactive)
            ceri.williams Ceri Williams
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist