I recall we had one problem with one table and we had to add a “_” to the beginning of the FK name.
[TOKU]# pt-online-schema-change
h=127.0.0.1,D=YSIUSER,t=ysi_files,P=3306,u=xxxx,p=xxxxx --alter
"DROP FOREIGN KEY _fk_files_user_id, DROP KEY
idx_dropbox_dateuploaded_numdownloads, ADD KEY
idx_dropbox_dateuploaded_numdownloads
(dropbox_id,date_uploaded,num_downloads), DROP KEY
idx_files_user_expdate_markdel_dropboxid, ADD KEY
idx_files_user_expdate_markdel_dropboxid
(user_id,sender_expiration,mark_delete,dropbox_id)" --progress time,3000
--chunk-size
50000 --lock-wait-time=360 --max-lag=5000 --no-drop-old-table
--max-load=Threads_running:25 --recursion-method=processlist
--max-lag=60 --critical-load=Threads_running:2500
--chunk-index=i_batch_file_id --execute
Altering `YSIUSER`.`ysi_files`...
Creating new table...
Created new table YSIUSER._ysi_files_new OK.
Altering new table...
Altered `YSIUSER`.`_ysi_files_new` OK.
Creating triggers...
Created triggers OK.
Copying approximately 735564447 rows...
Copying `YSIUSER`.`ysi_files`: 4% 18:10:24 remain
Copying `YSIUSER`.`ysi_files`: 8% 18:00:27 remain
Copying `YSIUSER`.`ysi_files`: 12% 17:28:02 remain
No comments:
Post a Comment