Page MenuHomePhabricator
Paste P6892

testing osc_host
ActivePublic

Authored by jcrespo on Mar 23 2018, 12:32 PM.
Tags
None
Referenced Files
F15996952: testing osc_host
Mar 23 2018, 12:32 PM
Subscribers
None
jynus@sangai:~/wmfmariadbpy/wmfmariadbpy$ pt-online-schema-change u=root,h=localhost,D=test,t=test --execute --alter "add column new_col int"
No slaves found. See --recursion-method if host sangai 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
Altering `test`.`test`...
Creating new table...
Created new table test._test_new OK.
Altering new table...
Altered `test`.`_test_new` OK.
2018-03-23T13:26:23 Creating triggers...
2018-03-23T13:26:24 Created triggers OK.
2018-03-23T13:26:24 Copying approximately 1 rows...
2018-03-23T13:26:24 Copied rows OK.
2018-03-23T13:26:24 Analyzing new table...
2018-03-23T13:26:24 Swapping tables...
2018-03-23T13:26:24 Swapped original and new tables OK.
2018-03-23T13:26:24 Dropping old table...
2018-03-23T13:26:24 Dropped old table `test`.`_test_old` OK.
2018-03-23T13:26:24 Dropping triggers...
2018-03-23T13:26:24 Dropped triggers OK.
Successfully altered `test`.`test`.
jynus@sangai:~/wmfmariadbpy/wmfmariadbpy$ python3 sql.py --host localhost test -e "ALTER TABLE test DROP COLUMN new_col" --no-dry-run
Results for localhost:3306/test:
0 rows in set (0.00 sec)
jynus@sangai:~/wmfmariadbpy/wmfmariadbpy$ python3 sql.py --host localhost test -e "SHOW CREATE TABLE test" --no-dry-run
Results for localhost:3306/test:
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
|---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| test | CREATE TABLE `test` (
`a` blob,
`test` int(11) DEFAULT NULL,
`test2` int(11) DEFAULT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
jynus@sangai:~/wmfmariadbpy/wmfmariadbpy$ python3 osc_host.py --host=localhost --db=test --table=test --method=percona "add column new_col int"
Host : localhost
Port : 3306
Databases : ['test']
Table : test
Alter SQL : add column new_col int
method : percona
pt dry args : ['--recurse=0']
pt args : ['--recurse=0']
ddl args : ['SET SESSION innodb_lock_wait_timeout=1;', 'SET SESSION lock_wait_timeout=60;']
analyze : False
continue? yes/no yes
host: localhost, database: test
SKIPPING test : test dry-run encountered problems
continue? yes/no no
abort
jynus@sangai:~/wmfmariadbpy/wmfmariadbpy$ sudo python3 osc_host.py --host=localhost --db=test --table=test --method=percona "add column new_col int"
Host : localhost
Port : 3306
Databases : ['test']
Table : test
Alter SQL : add column new_col int
method : percona
pt dry args : ['--recurse=0']
pt args : ['--recurse=0']
ddl args : ['SET SESSION innodb_lock_wait_timeout=1;', 'SET SESSION lock_wait_timeout=60;']
analyze : False
continue? yes/no yes
host: localhost, database: test
SKIPPING test : test dry-run encountered problems
continue? yes/no yes
jynus@sangai:~/wmfmariadbpy/wmfmariadbpy$ sudo python3 osc_host.py --host=localhost --db=test --table=test --method=ddl "add column new_col int"
Host : localhost
Port : 3306
Databases : ['test']
Table : test
Alter SQL : add column new_col int
method : ddl
pt dry args : ['--recurse=0']
pt args : ['--recurse=0']
ddl args : ['SET SESSION innodb_lock_wait_timeout=1;', 'SET SESSION lock_wait_timeout=60;']
analyze : False
continue? yes/no yes
host: localhost, database: test
SET SESSION innodb_lock_wait_timeout=1;
SET SESSION lock_wait_timeout=60;
alter table test add column new_col int
jynus@sangai:~/wmfmariadbpy/wmfmariadbpy$ python3 sql.py --host localhost test -e "SHOW CREATE TABLE test" --no-dry-run
Results for localhost:3306/test:
+---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
|---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| test | CREATE TABLE `test` (
`a` blob,
`test` int(11) DEFAULT NULL,
`test2` int(11) DEFAULT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`new_col` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary |
+---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)