Week 45: bunglings
Spent some time standing in some brambles to photograph a diverted bus – could have been much less time, if it wasn’t for various bunglings on my part, but it was a lovely sunny morning, and bucolic surroundings for listening to some podcasts and doing a life insurance medical interview (mostly saying “no” to each serious disease, extreme sport and war zone holiday destination listed) – which I actually did while bicycling along, which reminds me of inspirational time management exuberance Randy Pausch wearing a goofy headset to similarly multitask (in an era before AirPods Pro).
Some work. A dreadful long outage, which I dealt with not very sensibly – to my credit, sleeping through such things is probably quite healthy, but I perish the thought of how many nines I’ve lost.
There was a poorly database server, which I did some stuff to try to fix. Then, while I was waiting for a backup that turned out to be incomplete to restore, I deleted the most recent and only complete backup. None of it makes any sense, but it shouldn’t happen again, and there are some upshots:
Here’s a handy query for killing rogue long-running queries:
SELECT pg_cancel_backend(pid) FROM pg_stat_activity WHERE state = 'active' AND (now() - pg_stat_activity.query_start) > interval '1 minutes';
I once heard of somewhere where they had a cron job running a query like that every so often. If you needed a query to run for longer, you could include a comment (like “do not kill” or something) that prevented it being killed. But “the Russians used a pencil”. Better to set per-user timeouts, like:
ALTER USER frontend SET statement_timeout = 5000;
I’d been meaning to set this up for some time, but I was too lazy to look up the incantations for setting up users and granting them permissions. And look what happened.
Upgraded to PostgreSQL 11. It’s probably faster.
I’m now storing historic vehicle locations in Redis, rather than Postgres. It’s probably more suitable, isn’t it – old data will disappear automatically. And I know how to use Redis now.
Started watching Happy Valley, which as you must know is not about a magical elf leaping merrily, but rather the police. It’s really emotionally gruelling.
Another week cometh. Big week for coin/transition period fans. I’ve some fun and different things to do, which I suppose will serve as a distraction, and was going to say how looking forward to them I am, but I wouldn’t want you to get the wrong end of the stick and think I’m a coin fan.