pt-online-schema-change eating portion of a table
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
We have a situation where pt-online-
Please consider the following table:
CREATE TABLE `RICK_HOP` (
`ID` bigint(20) unsigned NOT NULL,
`ID_BOOKING` bigint(20) unsigned NOT NULL DEFAULT '0' ,
`ID_FLIGHT` int(1) unsigned NOT NULL DEFAULT '1',
`ID_LEG` int(11) unsigned NOT NULL DEFAULT '0' ,
`ID_HOP` int(11) unsigned NOT NULL DEFAULT '0' ,
`DEPARTURE_
`DEPARTURE_DATE` datetime DEFAULT NULL ,
`DEPARTURE_
`ARRIVAL_AIRPORT` char(3) DEFAULT NULL ,
`ARRIVAL_DATE` datetime DEFAULT NULL ,
`ARRIVAL_
`ID_AIRLINE` char(3) DEFAULT NULL ,
`ID_AIRLINE_
`PNR` varchar(20) DEFAULT '' ,
`CLASS_
`CLASS_TO_BOOK` char(1) DEFAULT '' ,
`FARE_BASIS` varchar(20) DEFAULT NULL ,
`CLASS_TO_BOOK_C` char(1) DEFAULT '' ,
`FARE_BASIS_C` varchar(20) DEFAULT NULL ,
`CLASS_TO_BOOK_I` char(1) DEFAULT '' ,
`FARE_BASIS_I` varchar(20) DEFAULT NULL ,
`SEATS` int(2) NOT NULL DEFAULT '0' ,
`DAY_CHANGE` tinyint(1) DEFAULT '0' ,
`FLIGHT_
`STOPS` int(11) DEFAULT '0' ,
`AIRPORT_CHANGE` tinyint(1) DEFAULT '0' ,
`ELAPSED_
`JOURNAY_
`ELECTRONIC_
`STATUS` varchar(20) NOT NULL DEFAULT '',
`FLIGHT_NUMBER` varchar(15) DEFAULT NULL ,
`AIRCRAFT` varchar(50) DEFAULT NULL ,
`VALUE1` varchar(255) CHARACTER SET utf8 DEFAULT NULL ,
`VALUE2` varchar(255) CHARACTER SET utf8 DEFAULT NULL ,
`ADT_
`CHD_
`INF_
`LAST_UPDATE` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `unique_
KEY `DEPARTURE_DATE` (`DEPARTURE_DATE`),
KEY `DEPAIR_DEPDATE` (`DEPARTURE_
KEY `LAST_UPDATE` (`LAST_UPDATE`),
KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Table contains 150,000 rows.
The first column 'ID' is candidate to become an auto_increment primary key for the table.
First 120,000 rows in the table have an increasing value for ID from 1 to 120,000 and we are using the following command line to change the ID column into an auto_increment primary key:
pt-online-
After the above completes successfully, the resulting table has 29,999 less rows than then original one.
This also happens with latest release (pt-online-
If we run the above ALTER command directly it works as intended (the 30,000 rows with ID=0 are correctly populated with auto incremental values).
We have noted that running without the "--no-check-plan" flag causes pt-online-
We are attaching a dump for the table that you can use to run the above command line and verify the bug.
Changed in percona-toolkit: | |
status: | New → Won't Fix |
If we run the same with ALL rows having ID=0, the tool will only copy ONE row!!