pt-online-schema-change script returns 1 even when there is no error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Expired
|
Undecided
|
Unassigned |
Bug Description
[In:Percona Toolkit Documentation]
Hi,
I'm using pt-online-
pt-online-
Operation, tries, wait:
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_
No foreign keys reference `MYBBDD`
Starting a dry run. `MYBBDD`.`DATOSAUX` will not be altered. Specify --execute instead of --dry-run to alter the table.
Creating new table...
Created new table MYBBDD.
Altering new table...
Altered `MYBBDD`
Not creating triggers because this is a dry run.
Not copying rows because this is a dry run.
Not swapping tables because this is a dry run.
Not dropping old table because this is a dry run.
Not dropping triggers because this is a dry run.
2014-07-07T10:25:28 Dropping new table...
2014-07-07T10:25:28 Dropped new table OK.
# Event Count
# ====== =====
# INSERT 0
Dry run complete. `MYBBDD`.`DATOSAUX` was not altered.
Ret:1
The script didn't fail and returns 1 ¿¿??
Now I altered the table manually and launch the script again:
pt-online-
Operation, tries, wait:
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_
No foreign keys reference `MYBBDD`
Starting a dry run. `MYBBDD`.`DATOSAUX` will not be altered. Specify --execute instead of --dry-run to alter the table.
Creating new table...
Created new table MYBBDD.
Altering new table...
2014-07-07T10:25:28 Dropping new table...
2014-07-07T10:25:28 Dropped new table OK.
# Event Count
# ====== =====
# INSERT 0
Dry run complete. `MYBBDD`.`DATOSAUX` was not altered.
(in cleanup) Error altering new table `MYBBDD`
# Event Count
# ====== =====
# INSERT 0
Dry run complete. `MYBBDD`.`DATOSAUX` was not altered.
Ret:1
It fails and returns 1, so, how can I check inside a script that the dry-run worked properly? is it the normal behavior of the pt-online-
Thank you
Hi, I have tried to reproduce the same but I'm getting 0 if its successful otherwise error. Can you check or provide that script that how it returns error when pt-osc is successful or not?
nilnandan@ nilnandan- Dell-XPS: ~$ pt-online- schema- change --alter 'ADD KEY i_c(c)' h=127.0. 0.1,u=root, p=root, D=dbtest, t=sbtest --nocheck-plan --alter- foreign- keys-method auto --statistics --dry-run foreign_ keys, 10, 1 foreign- keys-method. .`_sbtest_ new` OK. nilnandan- Dell-XPS: ~$ nilnandan- Dell-XPS: ~$ echo $? nilnandan- Dell-XPS: ~$ nilnandan- Dell-XPS: ~$ pt-online- schema- change --alter 'ADD KEY i_c(c)' h=127.0. 0.1,u=root, p=root, D=dbtest, t=sbtest --nocheck-plan --alter- foreign- keys-method auto --statistics --dry-run foreign_ keys, 10, 1 foreign- keys-method.
Operation, tries, wait:
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_
No foreign keys reference `dbtest`.`sbtest`; ignoring --alter-
Starting a dry run. `dbtest`.`sbtest` will not be altered. Specify --execute instead of --dry-run to alter the table.
Creating new table...
Created new table dbtest._sbtest_new OK.
Altering new table...
Altered `dbtest`
Not creating triggers because this is a dry run.
Not copying rows because this is a dry run.
Not swapping tables because this is a dry run.
Not dropping old table because this is a dry run.
Not dropping triggers because this is a dry run.
2014-08-04T15:20:52 Dropping new table...
2014-08-04T15:20:52 Dropped new table OK.
# Event Count
# ====== =====
# INSERT 0
Dry run complete. `dbtest`.`sbtest` was not altered.
nilnandan@
nilnandan@
0
nilnandan@
nilnandan@
Operation, tries, wait:
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_
No foreign keys reference `dbtest`.`sbtest`; ignoring --alter-
Starting a dry run. `dbtest`.`sbtest` will not be altered. Specify --execute instead of --dry-run to alter the table.
Creating new table...
Created new table dbtest._sbtest_new OK.
Altering new table...
2014-08-04T15:34:06 Dropping new table...
2014-08-04T15:34:06 Dropped new table OK.
# Event Count
# ====== =====
# INSERT 0
Dry run complete. `dbtest`.`sbtest` was not altered.
Segmentation fault (core dumped) nilnandan- Dell-XPS: ~$ nilnandan- Dell-XPS: ~$ echo $? nilnandan- Dell-XPS: ~$
nilnandan@
nilnandan@
139
nilnandan@