Top
Best
New

Posted by madflojo 9 hours ago

If you want failover to work well, use it often(bencane.com)
307 points | 82 comments
trollbridge 8 hours ago|
A thousand times, yes. I now do rolling reboots in my clusters, partly because I needed to get a lot better about keeping them patched.

Once you trust your HA, you just take the server or service offline, do what you need to do, and then turn it back on. And you have a backup plan of “it’s trivial to just spin up a new server because we made sure to test that regularly, too”.

Occasionally we do “pull the power cord” (or more realistically tell the ups/peu to turn it off), and then testing that AMT/iLO/iDRAC/whatever functions to turn it back on. If you have things set up properly this can all happen with almost no effort via an agent harness.

The same is true if you’re relying on clustered storage or RAID at all. You’d better periodically just fail over off a drive (and should do this rolling) instead of waiting for a drive to fail.

rskeens 5 hours ago||
Prior workplace had DR Days every year and they were a thing to look forward to. When it was first implemented, nothing went to plan but after just a few years there was only minor anxiety each time.

Nothing filled blindspots in staff documentation more than those findings.

hinkley 3 hours ago|||
One of the things about cloud providers is you can do drills of trying to migrate the entire thing to a new region to test worst case disaster recovery. The tricky bit is making sure nothing touches the old region due to hard coding.
jamesfinlayson 2 hours ago||||
I worked in a place that did a yearly disaster recovery check - it wasn't a very good check obviously as they actually needed it one day, and it took about a week to recover from the disaster.

Meanwhile somewhere else, dedicated servers were used heavily but failover happened monthly at most, but regularly more often.

sandeepkd 5 hours ago|||
The transitions I have seen so far -> actual DR exercise -> table top exercise -> DR lives in the doc presentation or strategy documents

I miss it though. Somewhere down the line the expectation bar has gone down in a circular fashion

hinkley 3 hours ago|||
The problem there is that is opens the feedback loop for memory leaks. And that becomes a situation that hits around the holidays because you deploy less which means the application runs 2, 3x longer than it usually does, for three weeks out of seven.
xyzzy_plugh 3 hours ago|||
I highly, highly recommend a forced rotation of a week max, such that all deploys/hosts roll over on a weekly basis. For large clusters I recommend that nodes continuously churn so that there is always a rotation in progress.

I don't recommend this to paper over memory leaks -- you still need to fix those! But it results in tremendous stability.

Spivak 16 minutes ago|||
The key to making this feel less arbitrary is making stability is a secondary effect of something the business already wants—velocity. By having your CI pipeline be fast, meaning the time from approve to deployed should be sub 30 minutes, sub 15 ideally, you're running deploys continuously (during the workday at least) and your velocity and responsiveness to issues and bugs goes way up while ops gets stability and predictability.
rednb 3 hours ago||||
Thanks for sharing this. This is something i'll definitely implement moving forward.
hinkley 3 hours ago|||
That’s no panacea either. Some requests that can fail at runtime still need to succeed during bootstrapping and restarting during “low traffic periods” invites getting paged during low traffic periods.

I did all but the last mile on autoscaling work. I thought we needed about three months more work, the guys who took it over decided it needed to be done in time for year end performance reviews. They skipped things and also ignored my advice on tuning parameters. Twelve days later we had the worst outage in two years because they didn’t account for unknown unknowns while I did. A bug in Operations’ Terraform did not preserve current machine count during a redeploy, and their initial min cluster size was laughably small.

In my next 1:1 I told my boss it was worse than that because they held a vote to ignore my advice of ramping down instead of jumping to best case. My boss was as appalled as I had been. Fucking told you so.

By the time they had dialed it in they had exactly the settings that I proposed which they thought weren’t aggressive enough. The fact that my numbers were not that compelling is why it had been my priority 3 instead of Priority 1 in the first place. It didn’t actually save us all that much more money than I already had with the work up to that point.

Our reloadable config system needed Consul to be up and populated during bootstrapping. If it went down any time after that it would fall back gracefully to the last known configuration and exponentially back off. In situations like that, turning off a server for 20 minutes a day is an increase in risk with zero upside, since billing doesn’t even work that way!

At the end of the day I think I probably didn’t make enough of a stink about how much and for how long I had been working on that problem and how it was foolish to reassign it at that point in the process. At a minimum it should have been all three of us with me cross training.

Give a distributed computing problem to people with no formal training and they always ask how hard could this really be. Real hard, but also not if you commit to do some counterintuitive things religiously.

PhilipRoman 3 hours ago|||
In some high reliability contexts you actually don't want an uptime higher in production than you've tested. This is not just due to leaks but various potential counter overflows, etc. If there is no significant degradation for the user, there is little reason to not reset the system periodically.

But I wouldn't necessarily aggressively restart servers that rely on netboot or other quirky, non-self-healing tech (systemd service ordering, DHCP, various VPN and network drive implementations)

hinkley 2 hours ago||
Consul was the bottleneck on ours. And while a Raft protocol is not the worst external dependency, it’s difficult to spin up from 0 so it limits the parallelism available to spin an entire region up from zero under a time crunch.
j45 7 hours ago||
It's a good idea to just schedule and proactively replace hard drives too, especially depending on the grade of it.
bonoboTP 7 hours ago|||
Good idea for infinite money, but if you don't have a huge storage cluster, modern disks don't fail all that much. Super rare for enterprise level ones. I've operated many dozens, I had like one or two fail over 5 years and those were already over 10 years old. I found SSDs more finicky.
hinkley 3 hours ago|||
For a project we bought 10 laptops and hired people after. Seven of those hard drives failed in about five months. Bad batch. Statistical clustering is what you’re planning for in disaster recovery. What do we do when no single point of failure can take out the system but three happen at once?
dapperdrake 6 hours ago|||
What about cycling through? The additional drive can be your "hot spare" or "cold spare".
trollbridge 6 hours ago||||
I have a fleet of server pulls which still are running 6-7 years later. In my experience once a drive gets past 50,000 hours, as long as you monitor SMART and temperatures it’ll last forever. (Proper airflow is essential.)

I generally run RAID-1C3 plus a hot spare (periodically take it to C4, and then back to C3 to rotate what the hot spare is), with a cold spare on the shelf. With CephFS it’s a bit different but basically the same idea.

toast0 7 hours ago||||
For home stuff, I try to replace hard drives on a schedule, but economics win. For work stuff, my experience was spinning drives offer pre-failure indication if you monitor smart; ssds fail less often, but I never got an indication before failure. Historically, most of my servers would be replaced before you really start to worry about storage lifetime, but hardware stays useful longer these days.

There have been firmware issues across multiple manufacturers where a lifetime counter rolled over and made the drive inaccessible ... if you knew in advance, you could pull those out of service before they failed, but how would you know.

For personal drives, I try to buy one at a time or at least bring them up a few weeks apart. For work drives, sometimes you just end up with a huge batch of servers coming online at the same time. Hopefully backups go to different systems.

throwaway270925 5 hours ago|||
No, it really isnt! What a stupid thing to say!

Use (soft)RAID, have hot spares, done.

Lemon drives usually fail within the first weeks, good drives keep running for years long after their 5th birthday.

BWStearns 1 hour ago||
I think there's a broader point here, which is if you want _anything_ to work well, use it often. Bugs spawn easier in rarely exercised code. One of the things I'll often push at work is that if we _have to_ be good at handling some Rare Scary Thing[0] then we should, if practical, try to bring the scary part into more commonly exercised code, because it makes the Scary Thing happen more often and you'll get better at it faster. Otherwise you end up making the happy path work and just kind of hope you covered the rest of it[1].

Failover is a great example because in many business cases you _have to_ be good at it when you have the very bad day, but there are ways to avoid it in steady state.

[0] E.g.: Complex authz logic, deploys, interactions with a fragile remote service, etc. [1] Obviously you shouldn't just cover the happy path, but you and the people you work for probably like money and it will be hard to justify pre-bulletproofing some edge case than the median one.

romanhn 8 hours ago||
I like the idea of injecting failover into the release process. Another similar approach is chaos engineering, where you intentionally introduce failures to validate your systems' reliability.

When I was at PagerDuty we regularly ran Failure Fridays (perhaps they still do). The goal was to identify a victim sub-system and start applying all sorts of failures to it - excessive latencies, dropped server connections, availability zone outages, etc. It was all done in a controlled manner, with the operations team sitting together with the service owners. The idea was that even if there is an impact to the customer, it's much better to catch it now and fix the underlying issue with many eyes on it, rather than a bleary-eyed on-call dealing with it in the middle of the night. This sort of exercise was very scary to get started with, and only minimally-impacting failures were introduced, but over time we got to the point where we were comfortable with simulating a full region outage.

That said, such investments in reliability made sense for PagerDuty. If a company can survive just fine with 2-3 nines of availability, it's a lot harder to make the business case for it.

mock-possum 7 hours ago||
Playing with compounding error/fail/degraded states is one of my favorite things to do during downtime - if I’m light on higher priority work, I’ll dig up a bunch of edge cases and write fixes for them, then turn it into a small writeup to share with the crew, so it doesn’t look like I don’t have enough ‘real’ work to do.
krapcys 7 hours ago||
[dead]
ww520 21 minutes ago||
In one of my previous jobs, we scheduled recurrent tasks (monthly/quarterly/annually) and one of them was fire drill to check failover on hardware failure. Failovers of frontline servers like web servers, app servers, cache servers, authentication servers were bread and butter, which were usually stateless. Needed to make sure the temporary reduced capacities not causing a cascaded failure. Failovers of storage servers and databases needed more attention. Needed to ensure transactions were committed/rolled-back correctly and data were consistent.
pizzafeelsright 8 hours ago||
One of my favorite was "Do you trust your RAID?'

Confident "yes"

And then I would put my finger on the tab to pull a drive.

If they didn't flinch I would pull the drive out.

al_borland 6 hours ago||
For years, back when the datacenter was down the hall from the offices, if we were doing an application upgrade we’d first go out and pull one of the drives from the RAID. If everything went well with the upgrade, we’d push the drive back in and let it rebuild. If something went wrong with the upgrade, we’d power down, boot off the drive we pulled, and be back up and running with minimal downtime.

Some nights I would pull dozens of drives. I guess we had a lot of trust in the RAID.

theokrueger 7 hours ago|||
i trust my RAID but would flinch knowing my hotswap doesn't work :(
nomel 7 hours ago|||
A certain type of hardware failure is indistinguishable from the drive being pulled out.
LoganDark 4 minutes ago||
I had this hardware failure recently. An SSD grew some bad sectors that, when read, caused the drive to just disappear. Poof, gone. It took ddrescue + over 400 manual replugs to get the remaining data off the drive. With Claude making a script to automatically proceed after each replug, it only took about 3 hours, which I think was perfectly reasonable.

The SSD had lasted 9 years, served me well. Rest in peace.

j45 7 hours ago|||
A hotswap raid isn't a raid if you can't pull a drive without thinking. Of course, raid 5-10 is minimum and mandatory.
podocarp 43 minutes ago||
Not entirely the case, for example NVMe doesnt really have a consensus on whether its hot swappable today, some work and some dont work unlike HDDs
TacticalCoder 5 hours ago|||
[dead]
esikich 5 hours ago|||
I did this many years ago with a client who had bought a big server upgrade to demonstrate what they had just paid for. Server crashed immediately. Found that HP did not build the server to specs, there was no RAID set up. Luckily I had someone to blame.
wjholden 3 hours ago||
This is really good advice and I think everyone in the industry is learning this the hard way right now because of the recent avalanche of AI-discovered CVEs.

I have an opinion that uptime is largely a vanity metric. It might feel nice to have a year of uptime on a router or server, but not if it has been a year since said device got updated.

It is a bad sign if management will not approve maintenance because they cannot accept downtime. The loss of any single device should, ideally, not create any outage. If it does, then this indicates a flawed system architecture. I like to frame it as, "this thing is so important that we can't maintain it."

torvald 8 hours ago||
I have a few saying that i often repeat at work, and one of them is; if you are afraid of doing it, you are not doing it often enough.
dangoodmanUT 8 hours ago||
This is the philosophy behind FoundationDB.

There aren't "normal" and "recovery" reconfigurations, there's just recovery (with a few exceptions for planned maintenance).

This means: 1) simpler code, 2) you're constantly testing the recovery path, and 3) the recovery path is designed to be quick because it's constantly happening

hinkley 3 hours ago|
I always remember a time in college when I was proud of my cat-like reflexes. I was ice skating, and started to fall. My gyrations trying not to fall at all ended up with me flat on my back, with ice skates near my head and arms. If I had taken a knee it would have been over quicker and safer.

I see people do the same thing at work all the time. You can hurt yourself trying not to hurt yourself. People try to make the happy path wider and deeper and let the corner cases get more expensive and use bad statistical thinking to justify it as an improvement. But the corner cases can come in clusters, and people train themselves to not see those clusters in the telemetry. But the customers see it, and the disconnect makes it worse.

vector_spaces 1 hour ago||
A daily life example of this with larger stakes involves GFCI/AFCI (RCD in Europe), and circuit breakers in general. You should regularly turn off all your circuit breakers to make sure they can indeed break the current, and you should regularly push the test button on your GFCI outlets/devices and GFCI/AFCI breakers to make sure they can actually trip. Shutoff/switching mechanisms can and do get stuck, and this can be very very bad in the case where you need it!
bombcar 1 hour ago|
Some GFCIs "self-test" internally, but it's worth making sure safety features actually work.
hinkley 4 hours ago|
I will say though that the first thing you need to know is not Practice Makes Perfect but rather Recency Bias. Eventually a process that works 98% of the time will convince you that it works 100% of the time and the safeties will come off. Human error will grow and grow until there is a reminder that you need to respect the process.

And to make any process popular, you also have to make it far more robust than you would have thought, because people judge on incidents per unit time not incidents per 1000 instances. Anything you want used 2x as much needs to aim for 4x stability. You will underestimate use and overestimate your improvements so you need a safety margin to reduce overall incidents per month.

More comments...