Unofficial Hacker News client - receive Push Notifications on replies.

If you want failover to work well, use it often (opens external site)

513 points by madflojo 1 day ago | bencane.com | 136 comments on HN | Vote on HN (opens Hacker News)

View full thread · View on Hacker News

Comment thread (40)

  1. 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.

    Replies (5)
    1. It's a good idea to just schedule and proactively replace hard drives too, especially depending on the grade of it.
      Replies (4)
      1. 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.
        Replies (3)
        1. What about cycling through? The additional drive can be your "hot spare" or "cold spare".
        2. 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?
          Replies (1)
          1. Yes, when buying disks for a big RAID, they should not come from the same batch. Good vendors take care of this.
            Replies (1)
            1. Best to still buy the same drives from different vendors if possible.

              Laptop manufacturers should be mixing it up but they might find it more useful to have the failures clustered.

        3. Most people don’t buy enterprise grade drives though.

          Western digital also lied about their CMR tech in their NAS grade drives.

          If one is using something like a synology, they are generally reliable and can run for 5-10y before anyone notices they’ve had it that long.

          Replacing drives at the 5-10 year range can happen naturally if the rain needs to be eventually grown as well. Having a spare drive on hand is something to factor into the original cost.

      2. 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.

      3. 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.

        Replies (1)
        1. I have seen the same, also it’s about how much load is on the drives and if that type of load is a strain for it.

          Smart drive notifications is key

      4. 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.

    2. 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.

      Replies (6)
      1. 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

        Replies (1)
        1. > DR lives in the doc presentation or strategy documents

          I imagine the answer to the question "Does the disaster recovery plan work?" is probably similar to "Do you backups work?".

          In flight training you rarely do "multiple unrelated failures" because you need tightly controlled scenarios for fair and efficient assessment. In ground school (or when you have extra time in the simulator) you can think about the systems and environment in more detail and be creative in solving bizarre, unrealistic problems. For experienced people doing the same thing every day this is a great opportunity for learning a couple times per year.

      2. 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.
      3. 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.

        Replies (1)
        1. A customer stopped a major patch of multiple systems with a notification two weeks prior, because it's "not enough time to set up emergency communication" at which point we wondered, what emergency let's your company set up communication over two weeks before anything bad happens...
      4. > DR

        Data recovery?

        EDIT: Wrong! It's "disaster recovery".

        Replies (1)
        1. disaster recovery
          Replies (1)
          1. Dang, so close. Thanks!
            Replies (1)
            1. It's only data recovery if the disaster recovery goes wrong. :)
      5. You should have probably done them more often than once a year (perhaps once a month) in those early days?
      6. In a previous job a customer had a monthly site switch.

        One time a technician messed up the switch, and the next time the switch started overwriting current data with old data (part of the switch procedure involved switching storage sources from a site to another).

        Another time a technician went the extra mile to fix the current site rather than do a failover because they hadn’t ever executed the failover procedure and wasn’t sure they could make it work correctly (the technician that had originally setup the DR failover had left the company and the current technician was fairly junior). Btw the junior technician from this specific episode was me circa ten years ago.

        DR procedures can often get very complex and technical, not really just a matter of ticking boxes left and right.

    3. 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.
      Replies (2)
      1. 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.

        Replies (5)
        1. Thanks for sharing this. This is something i'll definitely implement moving forward.
        2. 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.

          Replies (1)
          1. Well on the bright side your boss understood the problem -- tired of broken AB tests that border on fraud :|
        3. 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.
        4. > For large clusters I recommend that nodes continuously churn so that there is always a rotation in progress.

          And pay the AWS Config tax (if you use AWS). I mean, literally pay, as in it will cost you extra money if you use autoscaling a lot and have a poorly configured AWS Config setup.

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

          I'm not actually sure you really need to chase after slow leaks? It feels dirty, but honestly, restarting each part of the system randomly around once a day is good anyway. (Or once a week as you say.)

          If you can leak faster than that: sure, fix it. But if you slowly leak a few MiB per hour of running, you might just ignore it?

          Replies (2)
          1. The problem is if you don't chase it you can never be sure if this is just a slow leak, or a symptom of a more significant problem that hasn't hit yet. There are many many ways your system can be seriously wrong yet the only obvious symptom is the memory leak. Worse, once you accept one memory leak because it really is not a problem (in the majority of cases a small leak is not a problem under the constraints you have set) when a second memory leak can sneak in under your leak thresholds and be ignored even though the leak is just the first sign of a major problem.

            If there is a bug, no matter how minor, fix it before any other feature work is allowed. That is the only sane way to keep a system sustainable.

          2. > From: k...@rational.com (Kent Mitchell)

            > Subject: Re: Does memory leak?

            > Date: 1995/03/31

            > This sparked an interesting memory for me. I was once working with a customer who was producing on-board software for a missile. In my analysis of the code, I pointed out that they had a number of problems with storage leaks. Imagine my surprise when the customers chief software engineer said "Of course it leaks". He went on to point out that they had calculated the amount of memory the application would leak in the total possible flight time for the missile and then doubled that number. They added this much additional memory to the hardware to "support" the leaks. Since the missile will explode when it hits its target or at the end of its flight, the ultimate in garbage collection is performed without programmer intervention.

      2. 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)

        Replies (2)
        1. 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.
        2. Yes, I'd rather live through the 1000th groundhog day for your servers than getting to an uptime of 1,000 days that no one has ever tested.

          And in an emergency you might want to restart your system anyway for other reasons (like rolling out a fix), so having that path well-trodden is good.

          Replies (1)
          1. In a real emergency you won't have a choice about rebooting. When your fuel supplier can't get your backup generators more fuel...

            In the 1990s more than one company learned this the hard way. The mainframe had more than 10 years of uptime - every component was hot swap-able and that was tested often enough. However when the disaster (I heard stories from people who couldn't talk about details so I'm not sure what) took out all power and the generator - the system couldn't reboot because so many services that were started manually over the years by someone who since left ... nobody had a clue how to start them anymore (many needed some other unknown services running first). It took months to figure out what should be running and get the system back.

    4. > fail over off a drive

      ...and test the entire chain, up to and including paging on-call.

      You do have alerts for fail over events, right?

    5. This is also why I built certain data extraction / data migration workflows at work using restores from backup.

      One direct advantage: This lowers the risk of negatively impacting production, because it doesn't touch production.

      But much better, it acts as a continuous restore test, at least of yesterday. I can certainly construct many ways why this could be insufficient, but I know yesterdays backup can be restored. That's more than quite a few teams know.

      At the low price of enduring a bit of latency, which is fine for a lot of business processes.