pt-archiver not working as expected on partitioned tables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
On a table partitioned by key, invoking pt-archiver --purge does not delete all the rows matching --where.
Sample test case is attached, using these tables:
create table test_normal (
id int unsigned not null auto_increment,
row_a int unsigned not null,
row_b int unsigned not null,
ts timestamp not null default current_timestamp on update current_timestamp,
primary key (id),
key ts (ts)
) engine = innodb;
create table test_partitioned (
id int unsigned not null auto_increment,
row_a int unsigned not null,
row_b int unsigned not null,
ts timestamp not null default current_timestamp on update current_timestamp,
primary key (id),
key ts (ts)
) engine = innodb
partition by key (id)
partitions 20;
The test case populates the tables with 250 rows, and running this:
pt-archiver --purge --source S=/tmp/
successfully removes 250 rows, while this:
pt-archiver --purge --source S=/tmp/
removes less rows, and I have to keep invoking it until all rows are removed.
Reproduced on Centos 5.6 and Mac OS X 10.7.4
To use the test case, just unpack at a directory containing a MySQL sandbox and run ./init_test_case.sh
The script has a couple of comment lines with the used pt-archiver invocations, you just have to adjust the socket to use whatever is set for the sandbox used.
tags: | added: partitions pt-archiver wrong-behavior |
Changed in percona-toolkit: | |
status: | Confirmed → Triaged |
tags: | removed: wrong-behavior |
tags: | added: mysql-5.6 |
Confirmed with latest trunk pt-archiver.
Workaround is to give a large --limit, like --limit 1000
A similar bug was encountered in https:/ /code.launchpad .net/~percona- toolkit- dev/percona- toolkit/ pt-archiver- for-percona- 20933 but was fixed (tested with this too but can repeat the issue), looks like a similar bug.