When expire_logs_days has no effect

I’ve spent all morning setting up log rotation in MySQL, except some servers were not erasing old log files.

The idea is to set expire_logs_days to say 7. This means only the logs covering the last seven days will be kept on disk. If you need them, or a slave needs to read from them, they will be kept. But get rid of really old binary files.

You can set this in my.cnf and also at the MySQL console with:

set global expire_logs_days=7

Either the next time you restart mysql, or the next time you issue purge logs or flush logs, MySQL should rotate the current log file (create a new one with the index number incremented) and delete the files not newer than seven days.

Except while the rotation worked, the old files remained on some servers.

It turns out that the binary files had been rm deleted from the filesystem, but the index file not updated (it’s a text file). Issuing show binary logs listed all the old files no longer on the filesystem. As a result, the deletion was failing, as detailed by Baron in this bug (which has turned in to a feature request).

The fix? Stop mysqld, edit the .index file to remove entried no longer present, and restart mysqld. At this point if you have the expire_logs_days entry in your my.cnf file, MySQL will delete the old files as it starts, otherwise you’ll need to issue the flush logs command yourself.

Admittedly the title of this post is misleading – it does have an effect, just not the entire effect as documented.


Review of Rare Restaurant in Norwich, Norfolk, UK

One week ago, it being my girlfriend’s birthday, I decided we had to visit Rare.

Rare is a grill and stakehouse restaurant in Norwich, Norfolk. It is essentially a restaurant within a hotel, being located inside the Georgian House Hotel at the top of Unthank Road not far from the city centre.

Inside there is a very small reception. To your right a bar area for relaxing which we did not visit. To the right, a larger seating area with branded chairs and modern wallpaper. As you walk though, the kitchen is to your right. Keep walking and you’ll soon reach the end of the room with a door to the rest of the hotel.

There is no specific dress code but smart casual appeared common. The odd suit was also present. The staff dressed in conservative black with aprons and were professional and courteous at all times. Menus (available on their web site) appeared quickly enough revealing pricing in line with expectations given it is somewhat higher class without being out of reach of friends gatherings.

We skipped the starters which were priced around £4-£9. She chose the Salmon while I went for the Sirloin. Food did take a while to arrive, slices of still warm French Stick break with butter and sauce kept us going together with a couple of J2Os.

Main course was actually rather nice, served on modern sturdy plates with good quality cutlery. The taste and general quality of the food came across as high, justifying the list prices. We finished on Sticky Toffee Pudding (her) and warm chocolate fudge cake (me).

Overall we liked the place, the total bill coming to £50 including tip. They use a portable card machine so cash is not necessary.

Screwfix Laser Fluid Extractor – Perfect for oil changes

One word: Awesome.

Earlier this year I decided to tackle the job of changing the oil in my girlfriend’s car myself. This involved making use of my Dad’s trolley jack, axel stands, sawing some small blocks of wood to spread the weight between car body and stands, then actually getting the sump plug undone, and clearing up the mess afterwards. As this was the first time I’d ever done such a thing, the whole procedure took us (Dad and g/f helped) three+ hours.

And yesterday based on mileage it was again necessary. But thanks to a forum thread I decided to check out the Screwfix Laser Fluid Extractor.

This was in stock at the local retail shop on my way home from the office earlier in the week. In fact the guy said he didn’t even need to look up the shelf position because it was so popular he remembered where it was.

How does it work? Well, when you’re ready with the engine nice and hot, remove the oil dipstick and replace with the flexible tub rod connected to bottle in this kit. You then pump the used oil out. I used an engine oil flush fluid to get as much as possible out but that’s up to you.

Constructing it really it easy. Screw the handle into the pump. Place pump onto valve located centre top of the bottle. Place long tube onto side hole. Take out your oil dipstick and place tube in instead until you feel the bottom of the engine. Begin pumping. Nice workout for your arms for 2-3 minutes until you spot air bubbles in the transparent tubing, you know you’re done.

Change the oil filter. Make sure you have a tray or something under the filter as when you unscrew you’ll get a slick of hot oil and ensure you hold it upright as plenty of oil will remain inside. Fit new oil filter and simply replace old oil in car.

Ta-da. Really, really simple and I’m told this is essentially what the garages do anyway. Whole job including reading instructions, ten minutes of warming engine up with oil engine flush, doing the job and refilling it all: 45 minutes to 1 hour. It’ll be a lot quicker next time and I won’t need to read the instructions.

Second Gmail Outage in a week

Well, I just managed to log in using the Gmail https web interface but the past couple of hours both my accounts have been rejecting me with login failures via IMAP. The http interface was too slow and timed out minutes ago.

This is the second major problem in a week which for Google is a surprising downturn in reliability. Twitter is currently full of complaints as of this second.

Still, it is essentially free.

Amazon Cloud Runs Low on Disk Space

Another unthinkable (maybe in my mind only) has happened – errors uploading files to S3 led me to the AWS status page which reports the US East Coast facilities running low on drive space.

Am I the only one to have assumed someone or some thing was checking constantly, at least hourly, to ensure a sufficient percentage of drive space is available for use?

Apparently they consumed a whole lot more disk space than expected this past week and they are now feverishly adding more capacity. Surely if capacity can be added within hours they should have been gradually adding more during the week..?

This is actually pretty serious. People’s database backup jobs might be failing due to these issues although admittedly they need to be more resilient than that. But then so does Amazon.

Normal Bloke’s Identity Stolen

A colleague of mine recently received an email from his bank (genuine for once) thanking him for updating his card password.

Which he felt was strange because he hadn’t.

He called his bank and the automated line told him his balance was over GBP2,000. He then got through to a human who said it was under GBP200. The alarm was raised when the extra charges appeared to be on his card paying some financial institution my colleague had never heard of.

Anyway, the plot thickens.

A few days later this colleague of mine starts to realise how little postal mail he’s had. Not just him, the rest of the household too. So he spots the postman in the street and enquires.

“Yeah, well you were in the post office the other day getting it stopped, weren’t you?”

“No I wasn’t.”

“Oh shit,” The postman said as he got out his mobile and dialled the office to raise the alarm.

Apparently someone had just turned up to the local branch and ordered a hold on the mail to his address. The post office quite rightly has informed the police.

Amazingly, the next day my colleague gets some post. But it’s a little strange, because it’s some newsletter from the local church and, well, they don’t send out stuff to him. Conclusion? His identity has been stolen and the fraudster is collecting any new bank cards, replacing the genuine mail with fakes.

Now the next part of this is somewhat more personal. A week or two ago I booked tickets online to see the new Batman film but I couldn’t remember my Visa card password. So I clicked the forgotten password and was prompted for my date of birth and card expiry date, easy enough to remember/find out. Then I needed to set a new password.

And that was it. No security checks. No email to confirm the action by clicking the link within, no phone call to confirm intent, nothing.

Hardly any wonder people are now complaining that this lackluster security measure is being forced upon them.

Karcher K294MD Pressure Washer

Decided the car really needs a clean. As does my girlfriend’s. The good old bucket and sponge may be cheap and cheerful but fun it is not.

And so after reviewing various resources about pressure washers, went to Argos and brought home a Karcher K294M Delux unit, feeling £99.99 poorer as a result.

I assembled the machine yesterday afternoon and discovered two screws that no only required a start type driver bit but also an extension that they fit deep within the pastic mould.

One further problem. The British weather wasn’t “Sunny with occassional showers” it was in fact “heavy cloud with frequent showers” and as a result I couldn’t test the bloody thing. I returned to it this afternoon to fit the screws properly only to find one had gone walkies. Still I at least managed to power it on and use the variable power lance. Seems to work OK.

One problem I did spot was that our outside tap, despite it being connected to the mains supply, only gave me almost eight litres per minute. This model requires eight litres per minute so hopefully the motor won’t burn out prematurely, but the K380 model I was considering turns out to need ten litres per minute. Make sure you time how long it takes to fill a ten litre bucket with water FROM THE HOSE as a sensible test before you buy of of these things!

And the cars STILL need washing…