Live data from Hacker News

How we spent two weeks hunting an NFS bug in the Linux kernel

about.gitlab.com

21–30 of 69 posts

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#21
I had been experiencing a similar bug that we reported to Red Hat after being stumped. It started occurring out of the middle of nowhere but it would happen only in .01% of our jobs we launched into a batch farm. We launch about 15k batch jobs a day, and it was enough to be a problem.

Before a job was launched, a daemon pre-staged some job contents (logfiles, env, etc..) and started writing out to a job summary file. Then the job would start, continue writing to one of the files, which would become corrupted.

It ended up being this bug: https://www.spinics.net/lists/linux-nfs/msg41335.html

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#22

Representing such an example of work in a job application / resume / interview would be more valuable to me than a college degree. Due diligence and persistence — in the face of real-world, difficult, hundreds-of-moving-parts technical issues — are worth every penny. EDIT: Yes, college degrees require due diligence and persistence, but they offer no indication of the willingness to exercise those skills _after_ colle…

i recently graduated and started work.

academic achievements, relating to actuall work, is a drop of piss in an ocean. my experience at a university actually made me lose respect for academics.

edit: who ever is downvoting is romanticizing the achievements of scientists of yore. or thinks that MIT is the norm.

no, for the most part its publish or die, ive heard professors refer to students as "harvest" and laugh, while copying slides off of google. ive seen professors lie their way into grants.

all that contrasted with how the industry actually works and its needs, and what it actually require the universities to produce.

yeah, ive become a achievement oriented cynic. titles truly only make me think less of a person if thats all they have to impress with.

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#23
post #19
post #2

I spend my days chasing bugs like this in the FreeBSD kernel, and make heavy use of dtrace. I expect that using something like bpftrace(1) might have accelerated their debugging as compared to inserting stack traces and prints... (1): http://www.brendangregg.com/blog/2018-10-08/dtrace-for-linux...

We're getting there! :) I've asked my team to balance learning K8s with new learning lower level debugging tools like bcc and it's cohort.

That's awesome. I see too many younger staff know the hotness but not the fundamentals, and not enough employers care. I've had to strace a K8s cluster before where it turned out the problem was in kube-dns.

We are relearning the same things we did wrong in the 90s once we got nice libraries and middleware, i.e. to forget the platform we're building on.

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#24
post #18

To be honest, NFS is usually more pain than it is worth it. (But hey, at least it's not iSCSI) Yes please let the default not allow me to unmount a fs from a server that died.

Does anyone know why NFS is such a pain? In the past (10 years ago) I just assumed I was doing it wrong and stopped using it, and have not used it since.

In my experience, the quality of NFS client implementations varies significantly between different operating systems. We made _heavy_ use of NFS for home directories and application backing stores at the University where I used to work, and it was a very good experience -- but this was on Solaris 10 (and later, OpenSolaris) machines. We had heavy NFS client use on many multi-user machines (shell servers, Sun Ray servers, etc) and didn't see reliability problems. On the odd occasion that we needed to reboot the file server for updates, clients would pause and then resume promptly after the server rebooted.

Towards the end of my tenure there, I gave a Linux desktop a try. The NFS experience was amazingly bad by comparison; lots of issues with locking, with becoming disconnected (often until a reboot) from NFS servers, odd performance issues, reliability issues with the automounter, etc.

In the last few months I have tried the NFS client on my current Linux desktop again, thinking things might have improved -- they have, I guess, but not by much. It's still pretty easy for the client to get into a hung state if there's too much packet loss, or if the file server reboots, or whatever. I have to imagine that not enough people are really using Linux NFS clients in anger to drive fixing the issues with it. There is often no escape from the Quality Death Spiral.

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#25
Nice write up. It reminded me of the time I spent several weeks once trying to get OpenBGPD to work on OpenBSD.

First I tried getting some test VMs up and talking to each other. When I couldn't get that to work, I setup a few physical boxes to test it out.. When that didn't work either, I started debugging the code. A few strace's and some routine C debugging work later and I found a bug that would prevent any BGP connection from ever establishing.

A quick post on the OpenBSD listserv and the problem was fixed within day. (Wow that was almost 10 years ago?! How time flies)

https://github.com/openbsd/src/commit/13fba73cec6be16d64c86e...

We ultimately went with VyOS (back then called Vyatta) and Quagga but it felt good to find a bug like this.

Most of the work went in to confirming that there was an actual bug. Finding out where the bug was and fixing it was relatively trivial.

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#26
It's amazing how much we take the power of free and open source software for granted these days.

Imagine this same scenario if GitLab was using a closed source operating system. Would they have been able to track this down? Quite unlikely, but maybe if they were even more persistent and got lucky. Would they have been able to fix it? Absolutely not. They'd be at the mercy of the vendor.

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#27

GitLab has a strong engineering team. I appreciate this article. For those with experience, what's the best approach to introducing a documentation / "writing up a post-mortem culture" into a company that traditionally doesn't value these things?

It depends very much on your current scope of influence. It can be hard to change a whole company, but easier to start with yourself and your team. Try doing one and see how it is received.

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#28

To be honest, NFS is usually more pain than it is worth it. (But hey, at least it's not iSCSI) Yes please let the default not allow me to unmount a fs from a server that died.

I think NFS requires to have some knowledge for how you want to use it. The defaults seem reasonable, but I also get confused with all the v3/v4 differences etc. I use it at home to connect everything to my NAS and it works very well for me. My export is this:

  /mnt 192.168.8.0/24(rw,sync,insecure,no_subtree_check,crossmnt,all_squash,anonuid=0,anongid=100)

and my client config with autofs is this:

  rxd01 -fstype=nfs4,ro,soft,noatime,nodiratime,intr,rsize=65536,wsize=65536,nosuid,tcp,allow_other 192.168.8.3:/mnt/rxd01

If you know what each option does, how your network is setup and what your server/clients are capable of, you will eventually find the right settings, but it's not a good OOB experience.

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#29
post #22

Representing such an example of work in a job application / resume / interview would be more valuable to me than a college degree. Due diligence and persistence — in the face of real-world, difficult, hundreds-of-moving-parts technical issues — are worth every penny. EDIT: Yes, college degrees require due diligence and persistence, but they offer no indication of the willingness to exercise those skills _after_ colle…

i recently graduated and started work. academic achievements, relating to actuall work, is a drop of piss in an ocean. my experience at a university actually made me lose respect for academics. edit: who ever is downvoting is romanticizing the achievements of scientists of yore. or thinks that MIT is the norm. no, for the most part its publish or die, ive heard professors refer to students as "harvest" and laugh, whi…

You should name your university. So others can avoid it. Because not all are like that.

Re: How we spent two weeks hunting an NFS bug in the Linux kernel

#30
post #18

To be honest, NFS is usually more pain than it is worth it. (But hey, at least it's not iSCSI) Yes please let the default not allow me to unmount a fs from a server that died.

Does anyone know why NFS is such a pain? In the past (10 years ago) I just assumed I was doing it wrong and stopped using it, and have not used it since.

It's an extremely old design, designed primarily for read-sharing and with its concurrency features retrofitted. It worked absolutely fine for network-booting diskless Sun workstations in the 90s but its failure modes are just too annoying for modern usage.

Trying to do anything like a database (and the 'git gc' process described is exactly that, a tiny database) over NFS requires the use of very specific techniques to get right.

Sibling commentator has it right - for unreliable WAN networks S3 offers far better semantics, because it's not quite a filesystem.

Post reply on HN