We have an InnoDB table with 70 million rows, and we are trying to run the alter table statement to modify and add multiple columns. The query seems to have changed the table, and now it is in a state of "forced replacement of the table for storage."
START TRANSACTION; ALTER TABLE table MODIFY COLUMN column1 int(11) NOT NULL DEFAULT 0, MODIFY COLUMN column2 tinyint(1) NOT NULL DEFAULT 1, ADD COLUMN column3 int(11), ADD COLUMN column4 int(11) NOT NULL DEFAULT 1, ADD COLUMN column5 varchar(255); COMMIT;
It works overnight, and currently it is 19 hours. We don’t have the performance scheme turned on, so we can’t see the estimated completion time. My concern is what the request does, and whether the request will be rolled back if it is killed. I saw that other questions relate to queries that are stuck when copying to tmp tables or waiting for a table lock. However, I cannot find anything that you were stuck while writing the alter table.
Is it possible to kill a request in this state, and if the request is killed, will it roll back successfully?
Server starts MariaDB 10.2
source share