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

LP #1593184: pt-online-schema-change incorrectly reports to not drop tables




      **Reported in Launchpad by Stefan Schlesinger last update 06-06-2017 04:17:58

      In the following run pt-online-schema-change is incorrectly reporting
      to not drop the old table.

      Since it found that using drop_swap was required to update a foreign
      key, it still drops the old table.

      This is actually documented and a cosmetic issue.

      pt-online-schema-change --alter "ADD COLUMN archived INT(11) DEFAULT NULL AFTER conflicted" --execute --alter-foreign-keys-method=auto D=production,t=shoppers
      No slaves found. See --recursion-method if host db01 has slaves.
      Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
      Operation, tries, wait:
      analyze_table, 10, 1
      copy_rows, 10, 0.25
      create_triggers, 10, 1
      drop_triggers, 10, 1
      swap_tables, 10, 1
      update_foreign_keys, 10, 1
      Child tables:
      `production`.`shoppers` (approx. 129381829 rows)
      `production`.`shoppers_log` (approx. 89381829 rows)
      `production`.`shoppers_data` (approx. 89381829 rows)
      Will automatically choose the method to update foreign keys.
      Altering `production`.`shoppers`...
      Creating new table...
      Created new table production._shoppers_new OK.
      Altering new table...
      Altered `production`.`_shoppers_new` OK.
      2016-06-16T10:23:33 Creating triggers...
      2016-06-16T10:23:33 Created triggers OK.
      2016-06-16T10:23:33 Copying approximately 120302383 rows...
      Copying `production`.`shoppers`: 7% 62:04 remain
      Copying `production`.`shoppers`: 15% 54:27 remain
      Copying `production`.`shoppers`: 25% 52:19 remain
      Copying `production`.`shoppers`: 34% 47:45 remain
      Copying `production`.`shoppers`: 43% 40:15 remain
      Copying `production`.`shoppers`: 52% 36:42 remain
      Copying `production`.`shoppers`: 60% 30:15 remain
      Copying `production`.`shoppers`: 67% 26:53 remain
      Copying `production`.`shoppers`: 73% 20:39 remain
      Copying `production`.`shoppers`: 78% 16:22 remain
      Copying `production`.`shoppers`: 84% 10:02 remain
      Copying `production`.`shoppers`: 88% 06:48 remain
      2016-06-16T10:29:47 Copied rows OK.
      2016-06-16T10:29:47 Max rows for the rebuild_constraints method: 72288
      Determining the method to update foreign keys...
      2016-06-16T10:29:47 `production`.`shoppers_log`: 6023 rows; can use rebuild_constraints
      2016-06-16T10:29:47 `production`.`shoppers_data`: too many rows: 89381829; must use drop_swap
      2016-06-16T10:29:47 Drop-swapping tables...
      2016-06-16T10:29:47 Analyzing new table...
      2016-06-16T10:29:48 Dropped and swapped tables OK.
      Not dropping old table because --no-drop-old-table was specified.
      2016-06-16T10:29:48 Dropping triggers...
      2016-06-16T10:29:48 Dropped triggers OK.
      Successfully altered `production`.`shoppers`.




            lpjirasync lpjirasync (Inactive)
            0 Vote for this issue
            1 Start watching this issue



                Smart Checklist