pt-archiver not working as expected on partitioned tables

Bug #1044167 reported by Fernando Ipar
10
This bug affects 2 people
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/mysql_sandbox5512.sock,u=msandbox,p=msandbox,D=test,t=test_normal --where "ts <= '2012-12-01 00:00:00'" --progress 1

successfully removes 250 rows, while this:

pt-archiver --purge --source S=/tmp/mysql_sandbox5512.sock,u=msandbox,p=msandbox,D=test,t=test_partitioned --where "ts <= '2012-12-01 00:00:00'" --progress 1

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.

Revision history for this message
Fernando Ipar (fipar) wrote :
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

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.

Changed in percona-toolkit:
status: New → Confirmed
tags: added: partitions pt-archiver wrong-behavior
Changed in percona-toolkit:
status: Confirmed → Triaged
tags: removed: wrong-behavior
tags: added: mysql-5.6
Revision history for this message
Frank Cizmich (frank-cizmich) wrote :
Changed in percona-toolkit:
status: Triaged → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1018

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.