Not dropping old table while the option "--no-drop-old-table" is not specified

Bug #1735066 reported by Paul Namuag
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
New
Undecided
Unassigned

Bug Description

This is on version 3.0.5.

We did a pt-online-schema-change successfully, however, the message seemed to be confusing:

Copying `xxxx_schema`.`user_transactions`: 99% 00:15 remain
Replica lag is 8 seconds on opskins-phxdb17.mcmxi.services. Waiting.
Copying `xxxx_schema`.`user_transactions`: 99% 00:08 remain
2017-11-29T03:31:54 Copied rows OK.
Determining the method to update foreign keys...
2017-11-29T03:31:54 `xxxx_schema`.`fxeE4_cashouts`: too many rows: 2205426; must use drop_swap
2017-11-29T03:31:54 Drop-swapping tables...
2017-11-29T03:31:54 Analyzing new table...
SET foreign_key_checks=0
DROP TABLE IF EXISTS `xxxx_schema`.`user_transactions`
RENAME TABLE `xxxx_schema`.`_user_transactions_new` TO `xxxx_schema`.`user_transactions`
2017-11-29T03:31:55 Dropped and swapped tables OK.
Not dropping old table because --no-drop-old-table was specified.
2017-11-29T03:31:55 Dropping triggers...
DROP TRIGGER IF EXISTS `xxxx_schema`.`pt_osc_xxxx_schema_user_transactions_del`
DROP TRIGGER IF EXISTS `xxxx_schema`.`pt_osc_xxxx_schema_user_transactions_upd`
DROP TRIGGER IF EXISTS `xxxx_schema`.`pt_osc_xxxx_schema_user_transactions_ins`
2017-11-29T03:31:55 Dropped triggers OK.
Successfully altered `xxxx_schema`.`user_transactions`.

There, it says "Not dropping old table because --no-drop-old-table was specified.". However, the command we used is:
$ pt-online-schema-change --alter-foreign-keys-method=auto --print --progress time,10 --pause-file=/tmp/pt-osc.pause --alter=" \
CHARSET='utf8mb4', \
COLLATE='utf8mb4_unicode_ci', \
CHANGE COLUMN currency_type currency_type TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', \
CHANGE COLUMN coins coins DECIMAL(30, 18) NOT NULL, \
CHANGE COLUMN amount_coins_nocashout amount_coins_nocashout DECIMAL(30, 18) NOT NULL DEFAULT '0', \
CHANGE COLUMN new_coins_balance new_coins_balance DECIMAL(30, 18) NOT NULL, \
CHANGE COLUMN new_amount_coins_nocashout new_amount_coins_nocashout DECIMAL(30, 18) NOT NULL, \
CHANGE COLUMN coins_reverted coins_reverted DECIMAL(30, 18) NOT NULL DEFAULT '0', \
CHANGE COLUMN coins_nocashout_reverted coins_nocashout_reverted DECIMAL(30, 18) NOT NULL DEFAULT '0', \
CHANGE COLUMN comment comment VARCHAR(255) NULL DEFAULT NULL, \
ADD COLUMN flags INT UNSIGNED NOT NULL DEFAULT '0' AFTER comment \
" --tries copy_rows:1000:1,create_triggers:5:0.5,drop_triggers:5:0.5 --set-vars tx_isolation=\'READ-COMMITTED\',lock_wait_timeout=3600 h=100.0.1.14,D=xxxx_schema,t=user_transactions --recursion-method=dsn=h=100.0.1.14,D=percona,t=osc_dsns --critical-load threads_running=50 --max-load Threads_running=40 --max-lag 2 --execute

When I checked the code, there's only one line there but under "else" which I bet its the reason why it's printing this:
 9951 }
 9952 elsif ( !$drop_triggers ) {
 9953 print "Not dropping old table because --no-drop-triggers was specified.\n";
 9954 }
 9955 else {
 9956 print "Not dropping old table because --no-drop-old-table was specified.\n";
 9957 }
 9958

Solution: I see if we just have to enclosed that line 9956 to another "elseif" statement, might filter and avoid that from printing a false positive log information.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1463

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.