pt-archiver does not archive last row

392 views
Skip to first unread message

Eric

unread,
Jun 19, 2012, 2:02:56 PM6/19/12
to percona-d...@googlegroups.com
Hi ,
I am having a problem where pt-archiver is not archiving the last row from my tables.  It just leaves the last row behind.
And then when there is only one row in the table no archive takes place at all.
This happens on any table that i try to archive using where "1=1" technique from manual.

Am i doing something wrong? 

How to reproduce below.

Thanks,
-Eric

 pt-archiver --version
pt-archiver 2.0.3

CREATE TABLE `foo` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `modified_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1 

INSERT INTO foo values (null,null),(null,null),(null,null),(null,null),(null,null),(null,null),(null,null),(null,null),(null,null),(null,null) ;

select count(*) from foo; # from source
+----------+
| count(*) |
+----------+
|       10 | 
+----------+

/usr/bin/pt-archiver --source h=writer,D=test,t=foo,P=3306 --dest h=archive,D=test,t=foo,P=3307 --sentinel /tmp/pt-archiver-sentinel --replace --why-quit --where "1=1" --no-delete

 select count(*) from foo; # from destination 
+----------+
| count(*) |
+----------+
|        9 | 
+----------+

Baron Schwartz

unread,
Jun 19, 2012, 2:17:19 PM6/19/12
to percona-d...@googlegroups.com
It's a feature, not a bug. Please see the docs for --[no]safe-auto-increment.

- Baron

Eric

unread,
Jun 19, 2012, 4:38:55 PM6/19/12
to percona-d...@googlegroups.com
Adding --nosafe-auto-increment  fixed it.
I see where this option could be useful but, in my case the table is no longer being written to and I want to archive and drop it afterwards.

Thanks for the help.

-Eric



Reply all
Reply to author
Forward
0 new messages