MySQL SPs and Events being automatically rolled-back by Google Cloud SQL

試著忘記壹切 提交于 2019-12-08 09:01:41

问题


I have migrated my production MySQL schema to Google Cloud SQL. Various modifications have been necessitated to existing Stored Procedures & Scheduled Events, and some new ones deployed. HOWEVER, I have been noticing that where I leave everything working at 6PM, by the time I arrive back at my desk next morning, many (all?) SP & Event alterations are rolled back to some earlier state to development, and all my routines are failing or going crazy. The Data itself does not appear to be affected or rolled back, and continuous new inserts are succeeding. I'm thinking that the automatic Backup / replication might be overwriting my SP & events. Anyone know how to control this? Thanks, -Paul


回答1:


Please issue a FLUSH TABLES after making changes to the stored procedures. That should decrease the chances of MyISAM tables not persisting a server restart.




回答2:


Cloud SQL will never rollback your database unless you trigger it via a restore from backup. Usually when we see things that look like rollbacks, what's really happening is data loss at the MySQL level. This usually means one of two things is true:

  1. You're using MyISAM tables, data loss is possible. Switch to InnoDB as soon as you can. We now offer MySQL 5.6 instances if there was a feature that was holding you back from InnoDB.
  2. You're using InnoDB, but your code isn't running commits, so when the database does shut down, no data is committed, and it's lost.

If both of these things is true, please contact cloud-sql@google.com and we'll look into it further. Hope this helps!



来源:https://stackoverflow.com/questions/23930802/mysql-sps-and-events-being-automatically-rolled-back-by-google-cloud-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!