News for hackers. Stuff that matters.
Re:How Meta Patches Linux at Hyperscale by hellozomo on Saturday December 02, 2023 @06:15PM (#38503190)
"Draining and un-draining hosts is hard."

I'd stop right there and fix that, because that's a bullshit reason. Cycling hosts in and out of service is easy unless you're not doing things properly.

The Linux kernel is simply not designed to be live patched and it's a total hack to try to do it, it will never work 100% of the time, always be a source of uncertainty, and always be expensive in terms of engineering work. Disaster will always be looming.

By contrast, fixing their system for taking hosts in and out of service, so that it's extremely robust and reliable would likely pay big dividends in reliability.

My guess would be that this approach is papering over organizational dysfunction. One team can patch all the kernels but one team can't make all the hosts support proper cycling in and out of service. And no one cares to fix it because there's no real incentive to do so. Only cool hacks and new projects are properly rewarded.

Re:How Meta Patches Linux at Hyperscale by WookieRushing on Saturday December 02, 2023 @07:12PM (#38503524)
Why do you think its easy?

There's a lot of systems where you can easily take down some hosts, but taking down more than N% at a time causes issues. If your fleet is large enough then you are limited by the largest set of hosts where you can only take N% down at a time. Now you could say keep the sets of hosts small or N% large. But that can cause other issues as you typically lose efficiency or zonal outage protection.

A solution to this could be VM live migration or something similar. This breaks down for storage systems where you can't just migrate those disks virtually since they're physical disks or places that don't use VMs.

Re:How Meta Patches Linux at Hyperscale by tysonfurytoo on Saturday December 02, 2023 @06:44PM (#38503376)
It may be easy to cycle hosts in and out, but it can also be time consuming, apparently. In the article it mentions taking 45 days to patch all hosts. The article also points out that this is too long for security updates.

Nothing will work 100% of the time. If their patching mechanism is thoroughly tested and battle hardened, I think the risk would be acceptable. Once you do the initial kpatch security upgrade, you could even schedule the machine for serivce so that it's not relying on that, limiting your exposure to bugs.

Re:How Meta Patches Linux at Hyperscale by fragmede on Saturday December 02, 2023 @07:48PM (#38503735)
It's not a bullshit reason. You can put all the lipstick you want on the pig and put software all around it to make it all sorts of easy, but at the end of the day, having to reboot is a stop-the-(machine's)-world situation. Not having to do that is just better. Even if it doesn't work 100% of the time, that's still better than having to reboot the whole fleet. 45 days to reboot the whole fleet!

Throwing FUD and saying disaster is looming because its scary computer magic (out of MIT) was a scare tactic RedHat used to throw around about Oracle/Ksplice until they developed their own (Kpatch), then suddenly their sales team had to backtrack and say actually hot patching is good and can be trusted. I'm not saying it's not risky or dangerous, it's operating in kernel space, but that's why they pay really smart people to be careful when doing it, and not digital equivalent of a plumber who can't do more than glue libraries together.

A better understanding of the underlying technology so it's less magic might assuage your fear of it, but thinking Facebook is so dysfunctional that they haven't already made it easier to reboot is to misunderstand the problem at hand.

Re:How Meta Patches Linux at Hyperscale by natbennett on Saturday December 02, 2023 @07:36PM (#38503676)
The work that makes cycling hosts in and out easy is itself hard.

I agree that it’s the right thing to do but it’s hard.

Re:How Meta Patches Linux at Hyperscale by extr on Saturday December 02, 2023 @06:43PM (#38503370)
> My guess would be that this approach is papering over organizational dysfunction.

So what? At large enough scale organization problems are harder than technical ones: if you can fix the former with the latter, that's still a win.

Re:How Meta Patches Linux at Hyperscale by hellozomo on Saturday December 02, 2023 @10:17PM (#38504496)
But it's not "fixing" the problem, it's papering over the problem by piling tech debt on top of tech debt.

Framing this like it's a good thing is my only objection.

Re:How Meta Patches Linux at Hyperscale by mypalmike on Saturday December 02, 2023 @08:43PM (#38504021)
> fixing their system for taking hosts in and out of service, so that it's extremely robust and reliable would likely pay big dividends in reliability.

Facebook hosts can be robustly cycled. Of course. They've been doing this stuff for years. They've figured it out. That's not the issue.

Scaling up brings about new problems. This article specifically mentions the 45 day rolling restart issue. That's not an issue when you have 1000s of servers. It's one that shows up a couple of orders of magnitude later.

So you either solve the problem with a hack like kernel patching or you work to reduce restart times (drain + shutdown + OS restart + process initialization across every service). Get those restart times down 50% (good luck accomplishing that) and congrats, you're down to maybe a 25 day rolling restart, which is still quite a problem.

Re:How Meta Patches Linux at Hyperscale by hellozomo on Saturday December 02, 2023 @10:13PM (#38504479)
What exactly do you think requires cycling millions of hosts to take 45 days? That's a couple hundred hosts every five minutes across a large number of datacenters?

I wouldn't expect it to be halved by optimization. I'd expect it to be an order of magnitude faster and take more like 4.5 days.

I wouldn't be surprised (but I would be impressed) if they tried and got it down to a full cycle requiring one working day. That's around 1% of hosts cycling every five minutes.

Re:How Meta Patches Linux at Hyperscale by xyzzy_plugh on Sunday December 03, 2023 @12:47AM (#38505143)
It's certainly weird. I've worked at ~million host scale where uptime never exceeded a week by default (with the odd carve out for problem child software supplied by vendors)

I'm betting it's moreso that teaching developers to write software that tolerates draining properly (or is even able to communicate draining) is too difficult for them so they work around it.

Re:How Meta Patches Linux at Hyperscale by sangnoir on Sunday December 03, 2023 @03:41AM (#38505744)
> It's certainly weird. I've worked at ~million host scale where uptime never exceeded a week by default

How many individual teams had software running on your hosts? How many those hosts were stateful, and were fragmented across hundreds or thousands of service groups that had their own fault tolerances and unknown (to infra team) warm-up times. Adding complexity (rolling reboots) to already complex systems is almost never a good idea - at some point, there will be an issue caused by hosts rebooted in the wrong order, or too many hosts of a certain type 2-dependency-levels down being simultaneously offline

Re:How Meta Patches Linux at Hyperscale by xyzzy_plugh on Sunday December 03, 2023 @10:51AM (#38507936)
I appreciate your attempt to invalidate my experience but your points are irrelevant.

> hosts rebooted in the wrong order

Order doesn't matter. Host groups set a threshold for unavailability. Hosts are not rolled unless availability targets are maintainable. Usually this just means the oldest host at any time will get rolled.

Facebook obviously uses hot patching kernel updates to work around a social issue. Instead if you are functionally able to prescribe a set of behaviors that teams must comply to, you can easily do things like rebooting the fleet monthly without impacting availability regardless of the statefulness or fault tolerances.

If I shoot a random host in your pool and it matters to you then you haven't achieved fault tolerance. I'm obviously not proposing shooting an unfair number of hosts to you.

Re:How Meta Patches Linux at Hyperscale by sangnoir on Sunday December 03, 2023 @05:24PM (#38511353)
> I appreciate your attempt to invalidate my experience but your points are irrelevant

That was not my intention - I genuinely would have appreciated answers to my questions as it be useful to compare the complexity of your setup versus Facebook. As an extreme case: million homogenous, stateless hosts are far less complex to manage compared a million heterogeneous, stateful ones, and very little translates from the former to the latter - in my experience.

> Facebook obviously uses hot patching kernel updates to work around a social issue.

Which I think is reasonable when you have tens of thousands of SDEs.

> I'm obviously not proposing shooting an unfair number of hosts to you.

I agree with you, but I'll go on to say "not shooting an unfair number of hosts" is a hard problem to solve at scale, unless you're willing to make it simple and make humans deal with it by continually draining/undraining services which costs a lot of money without increasing the top line, likely far more money than it cost to get a handful of engineers to write kernel splicing. So beyond it being possibly a social issue, it may be a cost/host utilization issue as well

Re:How Meta Patches Linux at Hyperscale by xyzzy_plugh on Monday December 04, 2023 @12:44PM (#38520362)
These are fair points but I'd add that continually draining amortizes to $0 as the fleet grows.

Even if you can splice there are benefits to limiting uptime, with maintenance reaping the majority.

Re:How Meta Patches Linux at Hyperscale by mypalmike on Tuesday December 05, 2023 @04:06PM (#38536895)
The amount of time needed to restart a fleet (without sacrificing availability) is correlated with excess server capacity. Excess server capacity is not free.
Re:How Meta Patches Linux at Hyperscale by raverbashing on Sunday December 03, 2023 @03:13AM (#38505664)
1 Million hosts over 45 days = 15 min per host

That's a very realistic/optimistic number (especially as you do want to wait for all services to be running and marked as healthy)

"Oh but you can batch this" sure, but you don't want too much of a big batch that will make your service slow or want to risk shooting yourself in the foot - like rebooting your whole control plane then figuring out it doesn't work like that

(The 45 days is probably an estimate as well, I'm not sure they actually do that server by server)

Re:How Meta Patches Linux at Hyperscale by exitheone on Sunday December 03, 2023 @04:42AM (#38505946)
That's still ridiculously slow. I'd expect them to have hundreds of Microservices. Each one of those should be able to handle a random restart at any point in time so they should absolutely be able to restart 100s of servers concurrently without major disruptions. Hell on Facebook scale a whole-Datacenter going down should not cause service disruptions.
Re:How Meta Patches Linux at Hyperscale by Closi on Sunday December 03, 2023 @05:26AM (#38506072)
This does assume that nothing is getting broken along the way.

Taking 45 days is probably more about caution and resolving issues systematically rather than pushing a big button and hoping you don’t cause issues.

I’d expect them to have thousands of microservices - and you only have to find a way to break one to cause big issues.

Re:How Meta Patches Linux at Hyperscale by exitheone on Sunday December 03, 2023 @05:45AM (#38506132)
Regular random crashes should be exercised regardless at Facebook scale. Not being resilient to that would be very unprofessional.
Re:How Meta Patches Linux at Hyperscale by BlackFingolfin on Sunday December 03, 2023 @05:53PM (#38511609)
That's not 15 minutes per host; that's 15 hosts per minute.
Re:How Meta Patches Linux at Hyperscale by raincom on Saturday December 02, 2023 @10:12PM (#38504475)
Redhat provides kpatches for 6 months, that's all. If you are running a year old kernel, no kpatches are provided for that kernel. Definitely, one needs to recycle hosts every six months.
Re:How Meta Patches Linux at Hyperscale by lokar on Saturday December 02, 2023 @11:00PM (#38504697)
At google we did pretty much the same thing. Aimed to be able roll a kernel in 30 days, but various edge cases always made it drag out at the end unless you really spend a lot of human time on it. So use kaplice for really critical stuff (where the patch was easy, not always the case).

A reasonable compromise in the real world.

Re:How Meta Patches Linux at Hyperscale by ungamedplayer on Saturday December 02, 2023 @11:14PM (#38504777)
At redhat, we just maintain kpatch and hire kernel engineering to do the same. Turn around is about a week for 40 variants of kernel.
Re:How Meta Patches Linux at Hyperscale by jb_gericke on Sunday December 03, 2023 @02:04AM (#38505416)
Yeah, especially with containerisation and orchestration / Kubernetes, I get that perhaps not everything is viable to containerise, but in 2023 this feels archaic and like a lot of (potentially unnecessary) engineering work.