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

pt-online-schema swapping tables

smith18smith18 EntrantCurrent User Role Beginner
.I did some research on pt-online-schema-change but still couldn't figure out on when table swapping happens -- if my application is still running and rows are still being added continuously then at what point percona makes decisions to swap the old and new tables? -- anyone ideas or suggestions on when swapping tables happens without losing my incoming data-- I really don't want to lose any data as there is no way to recover the lost rows. -- any help would be appreciated


  • carlos.salguerocarlos.salguero Percona Toolkit Developer Percona Staff Role
    At the end of the process, online-schema-change does a table rename like
    RENAME TABLE original_table TO table_new, temp_table TO original_table.
    Since this is an atomic operation, even if there are queries being executed on the server, they won't be affected and they will be executed in the new altered table.

  • smith18smith18 Entrant Current User Role Beginner
    will there be any lock on the table during the rename operation happens?
  • carlos.salguerocarlos.salguero Percona Toolkit Developer Percona Staff Role
    The program is not adding any extra lock. RENAME is an atomic operation and there won't be queries affected by it.
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.