Not the answer you need?
Register and ask your own question!

Can i safely cancel pt-archiver which is running for last 20+ hours

ashoknixashoknix EntrantCurrent User Role Beginner
Hello,

I have started this to delete rows.. It is running for last 20+ hours

pt-archiver --source h=localhost,D=XXX,t=ory_uint --purge --where "clock < '1527724800'" --purge --no-check-columns --no-check-charset --limit=1 --commit-each --statistics --progress=100

I would like to stop it.

Please advise.

Thank You!

Comments

  • carlos.salguerocarlos.salguero Percona Toolkit Developer Percona Staff Role
    Hello,

    You can stop ip since pt-archiver will try to catch the termination signal.
    From the documentation: https://www.percona.com/doc/percona-toolkit/LATEST/pt-archiver.html#error-handling
    ERROR-HANDLING
    pt-archiver tries to catch signals and exit gracefully; for example, if you send it SIGTERM (Ctrl-C on UNIX-ish systems), it will catch the signal, print a message about the signal, and exit fairly normally. It will not execute --analyze or --optimize, because these may take a long time to finish. It will run all other code normally, including calling after_finish() on any plugins (see “EXTENDING”).

    In other words, a signal, if caught, will break out of the main archiving loop and skip optimize/analyze.
    Regards
  • ashoknixashoknix Entrant Current User Role Beginner
    Thank you Carlos!

    I read through the link.

    From the pt-archiver - i see it so far it completed x M rows - So, when I cancel it via ctrl+c - does the pt-archiver deleted those rows that matched till ctrl+c ?
  • carlos.salguerocarlos.salguero Percona Toolkit Developer Percona Staff Role
    Yes, it will try to do a clean break.
  • ashoknixashoknix Entrant Current User Role Beginner
    ok thank you!
  • MilindMilind Current User Role Beginner
    HI Carlos, 
    Based on your comments. Actually i need to know if pt-archiver can wait if the source tables have any queries running on it then it let them complete and that and then it runs again. 

    pt-archiver --source h=127.0.0.1,P=3306,D=****,t=tbl1,u=*******,p=******** --where "LAST_UPD_DT > '2018-06-02' " --dest h=127.0.0.1,P=3306,u=********,p=*********,D=*****,t=tbl2--limit=50000 --ignore --progress 100000 --no-delete --max-lag=300s --sleep=1 --statistics

    so here if tbl1 has some bulk DMLs running on it for few hours then will it wait till the those transactions are complete or will it come out. 

    Also if I use --retries=100 or 1000 then will it try restarting the copy or will it fail?


Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.