4 ms·
Here is how we had our database deletion error, about 15 years ago. Our DBs had been on leased servers at a hosting company in New York City. They were getting
by tzs 6y ago
Here is how we had our database deletion error, about 15 years ago. Our DBs had been on leased servers at a hosting company in New York City. They were getting out of the datacenter business so we had to move. We were moving to colocated servers at a Seattle datacenter.
This was the procedure:
1. Restore DB backups in Seattle.
2. Set up replication from NYC to Seattle.
3. Start changing things to read from Seattle, with writes still going to NYC.
4. After everything is reading from Seattle and has been doing so with no problems for a while, change the replication to be two-way between NYC and Seattle.
5. Start switching writes to Seattle.
6. After both reads and writes are all going to Seattle and it has been that way for a while with no problems, turn off replication.
7. Notify me that I can wipe the NYC servers, for which we had root access but not console access. I wasn't in the IT department and wasn't involved in the first 6 steps, but had the most Unix experience and was thought to be the best at doing a thorough server wipe.
My server wipe procedure was something like this.
8. "DELETE FROM table_name" for each DB table.
9. "DROP TABLE table_name" for each DB table.
10. Stop the DB server.
11. Overwrite all the DB data files with random data.
12. Delete all the DB data files.
13. Delete everything else of ours.
14. Uninstall all packages we installed after the base system install.
15. Delete every data file I could find that #14 left behind.
16. Write files of random data to fill up all the free space.
The problem was with step #6. They declared it done and turned it over to me for step #7 without actually having done the "turn off replication" part of step #6. Step #8 was replicated to Seattle.
It took them a while to figure out that data was being deleted and why that was happened.
We were split across three office buildings, and the one I was in had not yet had phones installed in all the offices, and mine was one of the ones with a phone. None of the people whose offices did have phones were in, so they lost a few more minutes before realizing that someone would have to run a couple blocks to my office to tell me to stop the wipe.
It took about 12 hours or so afterwards for them to restore Seattle from the latest backup, and then replay the logs from between the backup time and the start of the deletes.
After that they were overly cautious, taking a long time to let me resume the NYC wipe. They went right up to the point where I told them if we didn't start now we might not finish, and reminded them that those machines had sensitive customer personal information on them and were probably going to end up being auctioned off on eBay by the hosting company. They came to their senses and told me to go ahead.