On Wed, 2018-04-11 at 09:14 +0200, Matthias Sohn wrote:
Sure, that was the plan. I need to code this in JGit first though. What I did is revert [1] and patched Gerrit to list the content of the
parent folder of the packed-refs file right before Gerrit is about to update a reference. After the outage, I did not have time and our
"room for error/outage" bugdet was exhausted so I could not implement proper fix in JGit and test it.
Our servers are very stable these days so I will be able to test this patch on production before uploading it. I work on this as
soon as possible.
Thanks Hugo! We have trustfolderstat set to false and we're using 4.5.4 + my new fix and we're still seeing this exception. The team using these servers hasn't complained of a performance problem, but your improved fix does sound more optimal. I might get a change up for review this week (was going to be today, but got busy) that takes a stab at this.
As for the exception we're still seeing, it doesn't look like loose objects have any kind of protection from reading an outdated NFS cache (loose refs already do dir.list() a bunch, so I think they're good). I want to be able to add that protection without incurring a similar performance problem to packed-refs. For loose objects, currently the code checks the loose object cache, then continues on to look at packs if it can't find an object, and then finally falls back to looking for uncached loose objects. I was initially thinking we'd want some kind of outer wrapper when we've already checked both loose objects and packed and we still haven't found an object. Or we could choose to do similar to what we do with packs and do the directory listing (or it seems maybe dir open/close is enough) whenever we don't find the object during the final loose objects check.
Martin and I were also discussing if this is more of a 'refreshFolderStat' option, since we are trusting, just with a caveat. We could probably also re-work the packs check to do a directory listing or open/close for the objects dir so that we can trust the isModified result. And since we're really doing this pretty much any time we do isModified, we probably want to push it down into FileSnapshot. When I get a little more time I'll try to get some changes up for review for this stuff, but early idea feedback is welcome.
Nasser