How to move a DB from one machine to another and keep providing external services normally
When I move a db instance from one machine to another, our operation is to first open a db instance on the new machine (we put the file on the remote file system), and then close the old one after it is successfully opened. db, and finally switch routes. However, there will be some problems. First, it cannot be guaranteed that the data written in the old db will be perceived by the new db during the switching period. Second, the sst will be cleaned up during the close of the old db. At this time, the new db has been opened and cannot see updated manifest. If close the old db first and then open the new db, there will be a short period of unavailability.
Expected behavior
When scheduling a db to a new machine, it can avoid data loss and ensure availability. Can we explicitly trigger a collection of sst files when opening db? In this way, even if the old db recycles the sst files, the new db can remain consistent. Wondering if there is a suitable strategy to do this.
Actual behavior
Unable to perceive new sst and data