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

LP #1199589: pt-archiver deletes data despite --dry-run

    XMLWordPrintable

    Details

      Description

      **Reported in Launchpad by Jervin R last update 04-03-2014 12:36:21

      You can see on the last iteration of the pt-archiver command that --purge --dry-run is in the middle of the other options and it was not honored.

      [revin@forge ~]$ pt-archiver --version
      pt-archiver 2.2.3

      [revin@forge ~]$ pt-archiver --purge --dry-run --set-vars=innodb_lock_wait_timeout=5 --txn-size=1000 --statistics --bulk-delete --limit=1000 --optimize --primary-key-only --source=h=localhost,S=/tmp/mysql_sandbox55320.sock,u=msandbox,p=msandbox,D=test,t=ft_history --where='h_id > 900000'
      SELECT /*!40001 SQL_NO_CACHE */ `h_id`,`u_id`,`cn_id`,`f_id`,`h_date`,`h_ip`,`h_agent` FROM `test`.`ft_history` FORCE INDEX(`PRIMARY`) WHERE (h_id > 900000) AND (`h_id` < '1991667') LIMIT 1000
      SELECT /*!40001 SQL_NO_CACHE */ `h_id`,`u_id`,`cn_id`,`f_id`,`h_date`,`h_ip`,`h_agent` FROM `test`.`ft_history` FORCE INDEX(`PRIMARY`) WHERE (h_id > 900000) AND (`h_id` < '1991667') AND ((`h_id` >= ?)) LIMIT 1000
      DELETE FROM `test`.`ft_history` WHERE (((`h_id` >= ?))) AND (((`h_id` <= ?))) AND (h_id > 900000) LIMIT 1000

      [revin@forge ~]$ pt-archiver --set-vars=innodb_lock_wait_timeout=5 --txn-size=1000 --statistics --bulk-delete --limit=1000 --optimize --primary-key-only --purge --dry-run --source=h=localhost,S=/tmp/mysql_sandbox55320.sock,u=msandbox,p=msandbox,D=test,t=ft_history --where='h_id > 950000'
      SELECT /*!40001 SQL_NO_CACHE */ `h_id`,`u_id`,`cn_id`,`f_id`,`h_date`,`h_ip`,`h_agent` FROM `test`.`ft_history` FORCE INDEX(`PRIMARY`) WHERE (h_id > 950000) AND (`h_id` < '1991667') LIMIT 1000
      SELECT /*!40001 SQL_NO_CACHE */ `h_id`,`u_id`,`cn_id`,`f_id`,`h_date`,`h_ip`,`h_agent` FROM `test`.`ft_history` FORCE INDEX(`PRIMARY`) WHERE (h_id > 950000) AND (`h_id` < '1991667') AND ((`h_id` >= ?)) LIMIT 1000
      DELETE FROM `test`.`ft_history` WHERE (((`h_id` >= ?))) AND (((`h_id` <= ?))) AND (h_id > 950000) LIMIT 1000

      [revin@forge ~]$ pt-archiver --set-vars=innodb_lock_wait_timeout=5 --txn-size=1000 --statistics --bulk-delete --limit=1000 --optimize --dry-run --purge --primary-key-only --source=h=localhost,S=/tmp/mysql_sandbox55320.sock,u=msandbox,p=msandbox,D=test,t=ft_history --where='h_id > 900000'
      Started at 2013-07-09T22:12:30, ended at 2013-07-09T22:12:31
      Source: D=test,S=/tmp/mysql_sandbox55320.sock,h=localhost,p=...,t=ft_history,u=msandbox
      SELECT 19385
      INSERT 0
      DELETE 19385
      Action Count Time Pct
      bulk_deleting 20 1.0916 70.25
      commit 20 0.1457 9.38
      select 21 0.0165 1.06
      other 0 0.3000 19.31

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lpjirasync lpjirasync (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: