[Bug 586082] New: Upgrading mysql deletes /var/lib/mysql
http://bugzilla.novell.com/show_bug.cgi?id=586082 http://bugzilla.novell.com/show_bug.cgi?id=586082#c0 Summary: Upgrading mysql deletes /var/lib/mysql Classification: openSUSE Product: openSUSE 11.2 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Critical Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: abockover@novell.com QAContact: qa@suse.de Found By: --- Blocker: Yes I ran into a horrific scenario today. I upgraded my Linode (which hosts my blog, at http://abock.org) from openSUSE 11.1 to 11.2 via zypper dup, which upgraded MySQL. To my horror, /var/lib/mysql was deleted (which contained my WordPress database, among others). It was replaced with the "default" MySQL state/databases: ib_logfile0 mysql mysql-bin.000003 mysql-bin.000006 ib_logfile1 mysql-bin.000001 mysql-bin.000004 mysql-bin.index ibdata1 mysql-bin.000002 mysql-bin.000005 test My databases were nowhere to be found. Gone. Deleted. To add insult to injury, apparently backups haven't happened (which were scheduled via my crontab) since May 2009. I have restored the databases from the last backup, and will have to rebuild content hopefully from Google's cache. (Of course now I am looking into what happened with the backups over the last 10 months...) I looked at the 11.2 spec file for MySQL and don't see anything obvious, so maybe this is a core bug in MySQL? It's horrific. I don't trust anything. I strongly suggest the openSUSE package create a backup of /var/lib/mysql and of [mysqld]/datadir as specified in /etc/my.cnf when uninstalling and installing. This is horrible. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=586082 http://bugzilla.novell.com/show_bug.cgi?id=586082#c1 Aaron Bockover <abockover@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abockover@novell.com --- Comment #1 from Aaron Bockover <abockover@novell.com> 2010-03-06 21:05:25 UTC --- Aside: it seems backups stopped happening when I upgraded from 11.0 to 11.1. Sigh. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=586082 http://bugzilla.novell.com/show_bug.cgi?id=586082#c Marcus Meissner <meissner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |mhrusecky@novell.com |ovo.novell.com | -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=586082 http://bugzilla.novell.com/show_bug.cgi?id=586082#c2 Michal Hrusecky <mhrusecky@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P2 - High Status|NEW |NEEDINFO Info Provider| |abockover@novell.com --- Comment #2 from Michal Hrusecky <mhrusecky@novell.com> 2010-03-07 10:35:51 UTC --- My sincere condolences to you. I don't know how it happened either. Do you have /var/log/mysql/mysql-upgrade.log ? It may be in different directory depending on your settings. It may provide some clues about what has happened during update... -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=586082 http://bugzilla.novell.com/show_bug.cgi?id=586082#c3 Aaron Bockover <abockover@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|abockover@novell.com | --- Comment #3 from Aaron Bockover <abockover@novell.com> 2010-03-07 18:43:05 UTC --- I do not have that file. I only have /var/log/mysql/mysqld.log. It really was as if no "upgrade" took place - it feels like the dist-upgrade from 11.1 to 11.2 wiped things out and mysql was installed from a clean slate. I didn't see anything in /etc/my.cnf that might indicate where else this mysql-upgrade.log file might be located either. I do however have /var/lib/mysql/mysql_upgrade_info, but it doesn't contain any log data. The contents of the file: "5.0.51a" Maybe this file is critical to ensuring that subsequent mysql installs are upgraded rather than replaced? Maybe I was missing this file in 11.1? Just a guess... Thanks -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=586082 http://bugzilla.novell.com/show_bug.cgi?id=586082#c4 --- Comment #4 from Aaron Bockover <abockover@novell.com> 2010-03-07 18:59:52 UTC --- Playing around with different scenarios, I notice that if I just do "zypper in -f mysql" to reinstall the package, I end up with two new databases in /var/lib/mysql: /abockwordpress@002efinal@002dbackup /abockwordpress@002ebackup (where abockwordpress is the working/original DB) More interesting is that after reinstalling the one package, I do end up with a /var/log/mysql/mysqld-upgrade.log (which contains innocuous data). Next, I tried "zypper remove mysql" (after restoring /var/lib/mysql from the pre "in -f" test copy). This worked cleanly and didn't affect /var/lib/mysql at all. It did not attempt to verify the integrity/compatibility of any of the databases unlike reinstalling with "in -f". Finally, I tried both scenarios again (in -f, remove/in) with the /var/lib/mysql/mysql_upgrade_info file removed. With "in -f " in this case, no attempt is made to check the databases as in the uninstall/install case. Same for the uninstall/install case. So far to me this seems like it may just be a dist upgrade issue. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=586082 http://bugzilla.novell.com/show_bug.cgi?id=586082#c5 Aaron Bockover <abockover@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|Critical |Major --- Comment #5 from Aaron Bockover <abockover@novell.com> 2010-03-19 14:22:29 UTC --- I have good news. After doing more cleanup on my Linode, I came upon a directory I had forgotten about (4 years old): /home/mysql-data. Of course - this just makes sense - I don't want data in my root partition. So the only bug here is that my modified /etc/my.cnf (to point to /home/mysql-data) was blown away during the dist-upgrade, and completely explains why there's a lack of upgrade logs in /var/lib/mysql - it never was used before. Dropping severity to Major since /etc/my.cnf is nuked in this scenario, but all my actual data is safe still. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=586082 https://bugzilla.novell.com/show_bug.cgi?id=586082#c6 Michal Hrusecky <mhrusecky@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |WONTFIX --- Comment #6 from Michal Hrusecky <mhrusecky@novell.com> 2011-06-06 06:50:09 UTC --- After a long time, I accidentally found out what happened. I renamed mysql package, keeping provides. Although there is %config(noreplace) for my.cnf, rpm doesn't respect that if there is packaged rename :-( Unfortunately, not really sure what to do about that. We can add a hook to the zypper and display that there are some files to be merged and possibly even try to merge them if user agrees (once we will have new mighty powerful fillup replacement which should come from this years GSoC). I at least documented this behavior in wiki[1] and will add it to the README.SuSE in 12.1. [1] http://en.opensuse.org/index.php?title=SDB:Switching_between_MySQL_variants -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=586082 https://bugzilla.novell.com/show_bug.cgi?id=586082#c7 Christian Boltz <suse-beta@cboltz.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |suse-beta@cboltz.de --- Comment #7 from Christian Boltz <suse-beta@cboltz.de> 2011-06-06 23:36:11 CEST --- (In reply to comment #6)
After a long time, I accidentally found out what happened. I renamed mysql package, keeping provides. Although there is %config(noreplace) for my.cnf, rpm doesn't respect that if there is packaged rename :-(
Sounds like you should open a bugreport against RPM. At least my common sense says it could count as bug ;-) - noreplace should just mean noreplace IMHO. (Please add the bug number as comment here.) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com