Killing database engines
Posted in 1992
Jonathan Leffler writes: > [ ... lots of good stuff deleted ... ] > Letting the engine run should not cause corruption. In the odd > cases where a FE program dies and the engine seems to go on forever > (typically chewing up masses of CPU time while it is doing so), you will > have to kill the engine. But do it gently: try signals 15 (SIGTERM) and 1 > (SIGHUP), and SIGUSR1 (which varies: 16 on System V and 30 on SunOS (BSD?)) > first, and allow it time (say 10 seconds) to respond in each > case, and only if all those fail should you go for the kill 9 (SIGKILL). Hmm, speaking as someone who's often had to pick up the pieces after my friends' kill -9's and tbmode -z (now safe with OnLine ?), I'd like a $0.02. Please don't take any of this as criticism, it ain't :-) I was told to kill -13 the backend (SIGPIPE: "the front-end's died"), after trying kill -15 ineffectually. Is this still reasonable, before trying anything more serious ? There was a bug (in Turbo ? May not be in OnLine) whereby the engine slept, waiting for a signal. You could tell by the way the tbmonitor screen didn't update, and the answer was to send it a SIGALRM. Is this just ancient history ? 10 sec for a rollback seems a bit short: even with a fairly small DB, it's often taken some minutes to sort itself out. Roughly as long as it took to get there, they used to tell me. So long as it looks like it's rolling back, I usually try to leave it alone. With OnLine, the whole DB shuts down/should shut down if an engine terminates abnormally. So kill -9 on one of the engines may have the same effect as a graceless shutdown. Insofar as you want to prevent any shared-memory corruption, this seems like a good idea: but it can come as a bit of a surprise to your other users ... Also, if you shut the system down, it'll still have to do recovery on the way back up and may take just as long (assuming it wasn't hung completely originally). Any thoughts ? > If you want dBase, use dBase: Informix doesn't licence things that way. See, I knew he had a sense of humour !! > Jonathan Leffler (johnl@obelix.informix.com) #include <disclaimer.h> All the best, thanks for the mail. Cheers - Tony. __________________________________________________________________________ Tony Heskett th@bnr.co.uk Voice: (+44) 279 402637 BNR, London Road, Harlow, Essex, CM17 9NA Fax: (+44) 279 451434