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?

I walked in on my wife…

…viewing HTML source code.  Can you believe that?

I mean, I know that while she’s not very technical, living together with me can leave some deep marks.  If she would start preaching Open Source or arguing about supremacy of Perl over Java – I would understand.  These things are coming out of my mouth way too often and they mean much more to me than they should…

But HTML source code?  I don’t even remember talking about HTML, let alone showing her how to do that.  How… where.. err…

She was playing one of those online strategy games – a clone of Duna.  And the website wasn’t fully supporting browsers other than Microsoft’s Internet Explorer.  And she uses Mozilla Firefox.  So, what does she do, when base captions aren’t displayed on the map?  That’s right, she opens up the HTML source code, navigates to the correct place and gets all the information she needs.  And not only that, she does it all calmly, in the most natural of ways, like she developed the site herself!
I am stanned.  I am amazed.  And, I am proud.  Way to go, baby!

Oh, THAT little thing

Accidental misunderstandings are fun.  They are tough to figure out, but, when over, can be a great source of fun.

I was wondering why all of a sudden Olga started giving me those looks recently.  The looks like I am an ignorant bastard who doesn’t care about anyone else.  Sometimes she was also complaining from the loud sounds that come out of my notebook.  Impossible I thought – I am wearing the headphones for a reason.  And there is no way someone can hear the sound from the headphones from another room.  She’s just making it all up to make me go to bed in time.

Today I realised though that she was right.  And the problem wasn’t in the headphones.  The problem was with the configuration of the soundcard.  Whenever I plugged the headphones in, I was sure that the sound from the speakers was gone.  But it wasn’t!  And, of course, wearing the headphones which played the same sounds that were coming out of the speakers, I couldn’t notice the problem.  It was only by accident that I took off the headphones when the sounds were still coming out and I realized what the problem was.  It took me five seconds to fix it.

For those of you who need a fix for this problem – it’s in the volume controls.  Sometimes, the volume settings can be differnt for headphones and for speakers.  And sometimes you can have a setting for the soundcard to automatically switch off the speakers when the headphones are plugged in.  In kmix this setting is in the Switches bar and it is called Headphone jack sense.  It should be on.

On the contrary

I was passing by this shop with large windows.  One of the shirts caught my attention.  It was a plain white shirt with a shiny (disco-style) writing on it’s back that said “Million dollar man”.

Somehow, I thought, the only thing that one can be sure about is that a person wearing this “Million dollar man” shirt doesn’t have a million dollars.

Murphy’s Law for kids

I have witnessed something today that made me think about Murphy’s Law and how easily it is extended to every action. Even those actions performed by children.

I was waliking the park with Maxim today, when we saw this boy who was riding a new bicycle. The boy was very proud (Lev: guess who am I talking about. OK, I’ll give you three attempts.). It turned out it was his second day on the bicycle and he was riding it very good. Without any tricks or anything, but solid – without fallings or ugly manouvers.

So, this boy was making circles around us. He was shining with delight. I complimented him on the newly acquired skill. And he started to show off. He made the face like he could ride all by himself, without any concentration or focus. He even started ringing his bell.

And that was the point where he lost control. His bike started going from left to rigth and back to left. He lost the touch of the pedals. His speed decreased, which made it even more difficult to keep the bike straight. He was about to fall on his face. Luckily, his reflexes were fast enough to jump off the bicycle and stay on his feet. The bicycle fell though. Noone was hurt.

But the look on this boy’s face was all about a question: “Why did it happen to me right now?”. It could have happened to him on any given moment in the last two days. And noone would have noticed it. And those who would notice, wouldn’t care for it long enough, and would forget immediately. But it happened exactly at the worst moment – when he was showing off.

The answer to the kid’s question is, of course, Murphy’s Law.

Little did the boy know about the worst moment though. The accident didn’t just happen when he was showing off. But the accident happened when he was showing off to a blogger. Now, the memory and humiliation of this accident will stay in the history of the Universe forever. And there is nothing he or anyone else can do about it. Because in exactly half a second I’ll press the ‘Publish’ button and within 30 seconds at least two major search engines will index this story. Oh, boy.
P.S.: Am I cruel or what?