MySQL misunderstanding

I’m writing this down to warn you and to burn it into my memory.

For one of my projects I am using MySQL with InnoDB tables.  Which are great, by the way.  So I have this really huge table – about 8 GBytes with few million rows – that I want to empty.  Without much thinking I start DELETE FROM mytable.  And I wait.  And wait.  And wait.  Then I go for a coffee.  I come back and wait.  Then I wait for some more.

Eventually, in about one hour, I got bored.  So, I terminate the query.  That was without much thinking too.  Can you guess why?

Right.  MySQL uses transactions for InnoDB tables.  Interrupted query triggered a rollback operation.  So, not only I just spent an hour waiting for the stuff to get deleted, but it won’t be deleted afterall.

That made me angry.  So, I decided that I should restart MySQL service.  I thought that killing MySQL process will make it forget about the whole rollback thing.  It didn’t work.

In fact, it made the situation even worth.  MySQL service refused to start until the rollback would finish.  Or maybe it was repairing table, I am not sure.  But it seemed more like a rollback.  So for the next thirty minutes, it was fixing stuff, while none of other projects could connect to the database.  Other projects were mostly websites that I host on my home server.  Very nice.

Of course, while it was working, I was searching for the solution on the Web, mostly in MySQL manuals and forums.  I came across a couple of other requests that were exactly like mine, but there were no answers.  I then went to #mysql channel on IRC, where the guys told me that they feel sorry for me (how kind), but there was no solution, except to wait.  Dang!

After the service came up, I simply removed the table (DROP TABLE mytable) and re-created it empty (CREATE TABLE mytable (...)).   I also found another way of emptying the table, which is TRUNCATE TABLE mytable, although it would behave exactly the same as DELETE FROM TABLE mytable on my version of MySQL (4.something).

Down, down, down.

My appologies for yet another downtime (approximately 12 hours).   Things were beyond my control yet again, due to a hardware failure.  I suspect that the 200 GByte hard disk that I’ve purchased recently isn’t doing a very good job.  It does have plenty of space and responds pretty fast, but something triggers server crashes with filesystem inconsistencies, that require full manual file system check.

The bad news though are that I am currently out of budget for hardware.  There is no way that I will go and buy another disk, unless of course, this one will die permanently.  Another alternative, of course, would be to do a one-time charge for all those people who’s sites and files I am hosting.  I don’t think this is a good alternative, so we’ll keep it in the sleeves for now.

Anyway, now everything is up and looks good.  Let me know if you’re missing anything.

Accident update. Final.

OK, I’m glad to report that the accident case is completely closed now.  Today I have received the money from Cosmos Insurance.  The final judgement was 70% of my fault (manouvering without looking in the mirrors, closing free way, etc) against 30% of the other guy (speeding).

All accounts have been settled, and all paperwork finished.  My car has been repaired and paid for, and the only thing missing is the proper rare right light, which I am waiting for to be shipped from Japan.  In the meantime light from another model has been installed, and, to tell you the truth, noone notices the difference.

Anyway.  Once again, I’m happy that there were no casualties and that noone was harmed or injured – just two cars.  I have learned my lesson, and I am not drunk driving anymore.  At least not after heavy drinks like vodka and tequilla.  I still drive after a glass of wine or beer though, but noone is perfect.  I am not driving to parties no more.  If I know I’ll be drinking, I take a taxi and it seems to work very well for me.

That’s all folks.

No astronomy for me

As I have already said several times, I am not very fond of astronomy.  It doesn’t interest me.  But I try to ‘get in’ and follow at least major events, such as Solar and Moon eclipses.  Even partial.

Obviously, I am not doing a very good job of it.  Many people notified and warned me that almost full Solar eclipse will be visible from Cyprus on March 29th.  I got these news via all possible channels – in person, over the phone, via email, RSS, and the rest of Web technologies too.  I made a mental note not to miss.

And I did.  I realized that I missed it about 10 hours after it was over.  Can you believe it?  Oh, you can, huh?  Well, I’ll tell you something better.  At the time the eclipse was taking place I was in bed, with my notebook on my lap, watching a movie.  And suddenly, in the middle of the movie, I realized that it was way too dark in the room and, therefor, outside for the lunch time.

Guess what?

I haven’t thought about the eclipse even for a second.  My reasons for insuffecient light were mostly weather related – clouds and such.  Of course, I didn’t spend my afternoon thinking about it.  Those were just a couple of brief thoughts.

But still.  I find it amazing – I was well informed about what was going on, I was actually planning to take part in observations, and I totally forgot.  And not only that – I didn’t pay any attention what-so-ever to the obvious marks and signs that were sent to remind me of what was happening.

My only hope is that my life won’t depend on my memory and organization.  Other then that – I am hopeless.

Parenting coincidence

Just a few hours ago I wrote this entry (in Russian) about Maxim’s first punishment. As bas as it was, I was all in hopes that it will eventually work. But not that I read the same technique used unsuccessfully by The Parent I am starting to have my doubts. Here is the quote from her post to get you started with technique:

Right now the crib also serves as the time-out area for when she behaves badly.

And here are the results of using that technique:

Jon left Leta in her crib for another round of time-out and came back into the living room to walk off some steam. When he told me what had happened I told him not to take it personally because she has done the exact same thing to me. “Leta’s pretty mature for her age,” he said trying to talk through the defeat. “She knows her letters and numbers and all that. I think she could handle it if we added on a few extra minutes to the time-out. Like 45.”

Or in one sentence: it doesn’t work. Now I am wodering if it just didn’t work with Leta, or maybe the complete approach is wrong. Any ideas?