[Bug 223209] New: mysql stop script timeout too short
https://bugzilla.novell.com/show_bug.cgi?id=223209 Summary: mysql stop script timeout too short Product: openSUSE 10.2 Version: RC 1 Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Network AssignedTo: mmarek@novell.com ReportedBy: dmueller@novell.com QAContact: qa@suse.de the mysql stop script does a standard killproc, which sends a -TERM and after 5 seconds a KILL to the daemon. This is not enough for a busy mysql daemon to shut down, and consequently, your database is corrupted or in an inconsistent state afterwards. the example scripts, as they come with the mysql distribution, have a TERM wait of 35 and *no* kill. the debian mysql scripts issue a "mysqladmin shutdown" instead, which is blocking until the daemon terminated. Whatever you decide for, but killing a daemon after 5 seconds is dangerous to your data consistency. filing against 10.2 because I just learned this the hard way, but also applicable to SLES10 (I guess). -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 mmarek@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |aj@novell.com ------- Comment #1 from mmarek@novell.com 2006-11-22 08:19 MST ------- Fixing this is not a problem technically, but for 10.2 AJ has to agree. -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 aj@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|Major |Critical Status|NEEDINFO |ASSIGNED Info Provider|aj@novell.com | ------- Comment #2 from aj@novell.com 2006-11-22 08:23 MST ------- I'll accept this until 2006-11-23 EOB. -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 ------- Comment #3 from mmarek@novell.com 2006-11-23 03:33 MST ------- Created an attachment (id=106681) --> (https://bugzilla.novell.com/attachment.cgi?id=106681&action=view) new rcmysql initscript -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 mmarek@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #4 from mmarek@novell.com 2006-11-23 03:40 MST ------- mysqladmin shutdown is not an option, as it requires the password of the mysql root user (I have the same problem with /etc/logrotate.d/mysql, but not rotating a small log file is less severe than not being able to shutdown mysql). Apparently, I can't prevent killproc from sending the SIGKILL if the first signal is SIGTERM :-/ So I replaced the killproc call with a bash function, see the attachment. I also increased the timeout to 60 seconds. I'd be happy if you could test it a bit. -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 aj@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aj@novell.com, lenz@grimmer.com Status|RESOLVED |REOPENED Resolution|FIXED | ------- Comment #5 from aj@novell.com 2006-11-23 08:36 MST ------- I'm not sure this is an optimal solution. We'll check it in - but I'd like to have a comment by Lenz Grimmer on it. Lenz, what do you propose? -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 ------- Comment #6 from mmarek@novell.com 2006-11-23 12:38 MST ------- (In reply to comment #5)
I'm not sure this is an optimal solution.
Yes, it's suboptimal, but I hope it has less problems than before. If Lenz proposes something better, I'll happili apply it. If you really don't like my approach, I can revert it and just use killproc -t<reasoneble value> -TERM ... Which will actually be the same for allmost all cases. (BTW: I would really love if mysqld would be able to open two unix sockets, one for normal connections and one, guarded by filesystem permissions, for connections without privilege checks. That way, we could connect to the server from cron, init scripts, etc. w/o requiring the root password in cleartext to be stored somewhere :)) -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 ------- Comment #7 from lenz@grimmer.com 2006-11-24 00:28 MST ------- Thanks for making me aware of this! In the future, please also raise such issues on our packagers@lists.mysql.com mailing list. This avoids me to be the bottleneck/SPOF, if I am not around... I agree that using "mysqladmin shutdown" is currently not the best solution, as it requires the mysql root user password. For now, I'd prefer if you would use an approach similar to ours, that simply gives mysqld some more time to remove it's PID file after it received SIGTERM before you shoot it in the head. We haven't heard of any problems with the value of 35 seconds we choose for our script. 60 seconds should really get you on the safe side. So the proposed change attached to comment#3 is fine with me. I like the idea of having some kind of admin socket, I will add this to our feature tracker. But it may be already obsolete since we introduced the mysqlmanager, which is supposed to replace the current mysqld_safe wrapper script. It is in charge of starting and stopping mysqld instances (but currently probably suffers from the same problem of requiring a password by default). Once 10.2 is out the door (which is looking great, btw! I was not able to report anything for 10.2b2...), I'd like to recommend you to take a look at it. Our init scripts have already modified to support it. Please see http://dev.mysql.com/doc/refman/5.0/en/instance-manager.html for the general overview. My blog entry at http://www.planetmysql.org/entries/2108 gives you a quick start in how to enable it. The instance manager will be enabled by default for MySQL 5.1 and up. Thanks! -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 ------- Comment #8 from dmueller@novell.com 2006-11-24 05:46 MST ------- the debian scripts have a workaround for the mysqladmin shutdown problem. basically they added a user that from local connect (root) can shutdown the server without password. -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 ------- Comment #9 from dmueller@novell.com 2006-11-24 05:47 MST ------- please also don't forget to fix this for SLES (if mysql is on SLES) -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 ------- Comment #10 from mmarek@novell.com 2006-11-24 07:43 MST ------- (In reply to comment #8)
the debian scripts have a workaround for the mysqladmin shutdown problem.
But this workaround stores the password in cleartext (in /etc/mysql/debian.cnf). -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223209 User mmarek@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=223209#c14 Michal Marek <mmarek@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #14 from Michal Marek <mmarek@novell.com> 2008-01-04 05:44:14 MST --- Fixed in sles9, sles10, 10.1 and newer. -- 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