MySQL Bug Deskbar plugin

Over at my junkcode section, I have mysqlbug.py which is a plugin for the GNOME deskbar panel applet.

If you’ve used Quicksilver on MacOSX, then you know the kind of app that Deskbar Applet is.

This one lets you type “bug 1234” and be given the action of “open mysql bug 1234”. If you type “edit bug 1234” it gives you the option of editing that bug number.

We’ll see if this proves useful.

Many thanks to kamstrup (one of the Deskbar developers) on #deskbar on gimpnet for helping me out with the plugin.

I totally heart Deskbar. It’s awesome.

Matt on Ruby resource management (and why you can do it elsewhere)

ERROR: The requested URL could not be retrieved (yeah, site didn’t work when i clicked on it from RSS).

Matt uses this bit of ruby code to demonstrate that here you can’t ever not close the file handle:

File.open('something.txt') do |fd|
# Manipulate the file through 'fd'
end
# File handle is now closed

Which seems pretty cool. However, a good C++ programmer can also acheive the same (or better) things!

For example, in NDB (well, in the portability library we use inside NDB) we have a class called Guard. The constructor for Guard pthread_mutex_locks a mutex. The destructor unlocks it. So, for when you’ve got some simple mutual exclusion you need doing, you can have bits of code like this:

{
Guard g(m_config_mutex);

if(m_config.foo<10)
return -1;

// other_stuff
}

Guess what, those nice little error checking bits that should just return -1 look a lot cleaner and you can never forget to unlock the mutex! You’ll see code like this in the management server (ndb_mgmd – source in storage/ndb/src/mgmsrvr/ mostly in MgmtSrvr.cpp).

In fact, you can do this with files as well (multiple ones)  and have them all closed on exit from the block. It’s all a matter of having (or writing) some good classes. I’m no Ruby expert – but I think you’d have to have more indentation to do that with two files?

a bug on failure failure

I’ve been working on BUG#17928, which is all about “testBackup fails in error handling testcases” which appeared after we merged in some work to the 5.1 tree (which is okay in 5.0) that changes some things in the way that online backups are done in NDB to better support recovery in the event of various types of failures and various times in the process.

Anyway, not all systems are affected by this bug… I’m at least reproducing some of the failures on my laptop and have spent the past while in the depths of the BACKUP and NDBFS blocks trying to work out what’s going on and why we’re hitting this assert.

NDBFS is an interesting block as it’s the file system interaction for NDB – so we’re doing things that could take an arbitrary amount of time. We don’t like waiting for those sorts of things in cluster, so we go on and do other work.

For backup, we buffer up writes and send FSAPPENDREQ (File System Append Request) to NDBFS only when we have a reasonable amount of data to send. For example, for very small rows being put into the log file, no use making a write() call for each row – batch them into big chunks!

Back to the bug; I’ve got a theory[1], half a patch and some work to do tomorrow.

[1] excluding gratuitous Buffy quote

Welcome – Ubuntu Linux 6.06LTS

Welcome – Ubuntu Linux

I took the plunge and last night I upgraded my laptop (my primary work machine – as in it cannot be busted[1]) to Ubuntu 6.06LTS (otherwise known as Dapper Drake. The LTS is for Long Term Support). It went pretty smoothly.

I had to remove irda-utils after the upgrade as a module being loaded was causing a panic (which showed itself by having everything freeze about 4 seconds after gdm started up and you’re about to enter your username). I should report a bug for that…

It’s slightly annoying that I had to disable gdm so i could see the panic to find out what was crashing. Perhaps we need either:

  • crash dumps (a-la IRIX and others where you can then run a debugger on an image of the crashed system)
  • panic over the top of X (a-la early MacOS X)

I have to say though, I am very pleased with the upgrade. Everything seems a bit snappier (much welcome) and NetworkManager works! I haven’t tried to suspend my laptop yet though.. so we’ll see if that works.

But a recent version of f-spot is welcome, I’m thinking I’m going to start using it for my photos. The next trick is going to be when i completely run out of disk space on my laptop for them.

The new Rhythmbox has me using it again. Disappointed not to see google talk support in gaim (although maybe i’m just not looking right).

The Window List still exists – a UI element I solemly think should die a quick death. It didn’t work in Microsoft Windows 95 with more than a few windows  open and it doesn’t work any better now (okay,  a little, but not much).

I want to take a second and marvel at the look of the new Human theme. It is rather lickable and, as we know, the only thing that matters with UI is how much you are licking your monitor. Even without wizz-bang GL compositing powered by cold fusion bucky ball quantum knot computers, it seems nice.

gnome-xchat is taking a little bit of getting used to, but the toast that pops up when somebody “stewart: hey”‘s me is useful.

Epiphany has received some updates too which are quite welcome. A bunch of elements used in phpBMS for Web 2.0 stuff are a lot faster. In previous blog entries I’ve said why I’m using Epiphany and not Firefox. I may re-asses this at some point, but I’m not really in any mood to manually move over saved passwords.

Evolution seems to suck up a bit less memory. Started out only using about 247MB. Now 338MB+52MB for evolution-data-server though…. maybe I’m just not feeling it as much due to other things chewing up less. WHY THE FUCK DOES IT TAKE 390MB FOR A PUNY 10GB[2] OR SO OF MAIL?

On the other hand though, there’s been a bunch of UI improvements in Evolution that are really welcome. I’m quite pleased with the upgrade.

My Bluetooth seems to have broken (my send image from phone to laptop didn’t work). I haven’t had time to debug yet.

Is it just me or do fonts look a bit better too?

I’m probably going to run beagle soon too.

The new version of Deskbar seems to work a lot better. I’ve noticed I’m using it more. Although is it worth 37MB of RES memory?
Tomboy seems to have gotten a bit better, but I’m still experiencing a bug where if i click anywhere that there isn’t text in my “Start Here” note I get a new note with some random large chunk of text from my “start here” note. I credit tomboy with a lot – namely a boost to productivity and not loosing notes. I massively heart it.

I’ll be trying MonoDevelop again to see how easy it really is to whip up something quickly. In breezy things seemed to crash too often to be useful.

The support for switching between audio output devices is much welcomed. However, there still seems to be some bugs – especially related to USB audio devices. I have an iMic here that I bought years ago and am again using since the headphone port on my laptop seems to be having problems (electrical connection related, not software).

Liferea (feed reader) has a lot of improvements. I think it’s chewing less RAM too.

I had to fiddle with my keyboard layout things to get my DVORAK layout working properly. It still seems as though Ctrl-Alt-Left Arrow (and Right) to switch between Workspaces only works for the left cntrl and alt – not the right ones (that are closer to the arrows). Although now the little keyboard applet shows “USA” for Dvorak, “USA*” for QWERTY and “Swe” for Swedish.
My build of MySQL that I use (for important things – i.e. my invoices that make sure I get paid) that is typically a close-to-top-of-tree 5.1 install kept working after the upgrade – i.e .binary compatibility didn’t get boned. I did, however, need to rebuild some of my MySQL source trees afterwards (some linking with SSL foo failed, clean build fixed it).

I also did a fresh install from the Desktop CD under VMWARE on another machine. Quite nice installer.

I feel like I’ll move my Mum’s machine over to 6.06LTS very soon (this weekend) as I’m confident it’ll be a great release for her. I’m sure she’s going to love f-spot. I’m also going to introduce her to rhythmbox, Sound Juicer and possibly last.fm as she now has speakers plugged into her computer and a CD player in her car (okay, had it for a while, just slack in getting her up and running burning copies of CDs for the car).

I didn’t get Avahi out of the box after the upgrade… I wonder if I need this manually for the “Share my Music” feature of Rhythmbox to work. Installing now, so I’ll soon know.

I haven’t tried Ekiga (GnomeMeeting, but new name) Internet Phone yet with any SIP things. Since I have a physical SIP phone (a SNOM-190) I may not really use it (except when travelling). Good to test at some point though.

The real OpenOffice.org 2.0 is much overdue – as I’ve sworn rabidly about before. Big difference being this version actually works.

A very worthwhile upgrade IMHO.

The next box to get the upgrade will by my MythTV box – or Mum’s. But probably both this upcoming (long) weekend.

[1] I, of course, have up to date backups and a quick disaster recovery process (get machine, xfsrestore / and /home, continue working). However, this is a pain in the arse.
[2] This may be wrong… “du -sh Maildir” just takes too damn long. My Maildir is currently 1.7GB in a tar.bz2 archive.

DaveM on Ingo’s SMP lock validator

DaveM talks about Ingo’s new SMP lock validator for linux kernel

A note reminding me to go take a look and see what can be ripped out and placed into various bits of MySQL and NDB. Ideally, of course, it could be turned into a LD_PRELOAD for pthread mutexes.

Anybody who wants to look deeper into it before I wake up again is welcome to (and tell me what they find)

last.fm

Set myself up on last.fm, changed to amaroK for playing music (so things go to last.fm) and added foo to the sidebar of my blog. I guess the trick now would be to get something to auto-add my current tune to the bottom of each entry. Maybe :)

I’m a GNOME boy, but amaroK seems to be leaps and bounds ahead of either rhythmbox or the version of banshee that ships with Ubuntu Breezy.

My main complaints with amaroK are that it looks nothing like my other desktop applications – it stands out that it’s a KDE app and not a GNOME app. Some clue on how to fix this would be appreciated.

Back to last.fm, I think the goal is to help suggest music that you may like by looking at what you listen to and what other people who listen to some of the stuff you listen to listen to. Seems interesting at least.

Newfangled technology to remove the “so what have you been listening to?” question from the list of things to talk about with friends :)

Moo, You Bloody Choir

Augie March – Moo, You Bloody Choir

While I was away (I think I was in Stockholm at the time… not sure actually), Augie March were doing signings of their new album at JB in the city. Jessie volunteered to go get me a copy. So when I got home, I had this waiting for me:
Moo, You Bloody Choir

with it signed by the band:

Moo, You Bloody Choir (signed)

It’s an awesome album too. I’ve really liked One Crowded Hour since I first heard it (a long time ago now) and am really pleased that it got onto a release. I’m also a fan of Clockwork and Vernoona and a whole bunch of other tracks.

They’ve got some gigs coming up, hoping I’ll be able to get to them.

In Sorrento (and awake!)

(almost) enough said. Good to see people again. Now just a talk to prepare for tomorrow.

Okay, not totally prepare – but a bit of it.

The one I’m giving today – on Cluster Replication is pretty much done. Would like to run through beforehand – but not sure how that plan is going to go.

Correcting some incorrect information about Cluster

While googling this morning, I came across: Arguments in favour of PostgreSQL – MoodleDocs. Unfortunately, there’s some factual errors about both MySQL and MySQL Cluster.

For a start, it seems as though the comparison is Postgresql versus MyISAM. Now, this isn’t exactly a fair comparison when it comes to some loads – especially anything when you want crash safety or transactions.

With InnoDB however, COMMIT means that the transaction is on disk and durable.

So, onto Cluster. The replication between nodes in a cluster is not asynchronous. When a transaction is COMMITTED, it’s in the main memory of more than one data node. I.e. the D for Durability. We are durable across node failure. A failure of the entire cluster can loose you some transactions, but only those since the last Global Checkpoint.A whole cluster failure should be a very rare event (read: never).

The comparison to Postgresql async writes is incorrect as in this case on COMMIT the transaction is not durable (unlike with MySQL Cluster).