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

Need for a two steps pt-online-schema-change

agoriagori EntrantInactive User Role Beginner
My use case is the following: I have two java servers. When I want to deploy a new Java application, I need to isolate one of them, deploy a new Java application, apply mysql schema changes, stop first server, activate second servers. Under this scenario, server1 is still working against the old schema for sometime.

What I would like to do is:
1. deploy new application in server2
2. create a new table
3. copy data into new table
4. keep new table in sync with old table (just old -> new, not the contrary)
5. block server1
6. recreate foreign keys pointing to new table
7. rename new table to old table
8. activate server2

It seems I need pl-online-schema-change but in two steps. First step comprises points 2-4. Second step points 6-7.
From 5 to 8 is the downtime period.

First question is: do points 6 and 7 take long time respect to the previous ones?
Second question is: can I achieve this in pl-online-schema-change?
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.