Repository navigation
lib: Handle case-insensitive filesystems - #6717
Conversation
3ae66e1 to
384deff
Compare
032f70d to
0423678
Compare
|
All the basic pieces for handling case-insensitivity are in place now. Disclaimer: I haven't done any testing, the |
3317721 to
fc1f58d
Compare
|
I ran the many files integration benchmark twice on master and this branch, and the results are all over the place. At least it's not obviously extremely much worse. However I'll run them later on an beefier, more idle machine than my laptop to hopefully get a bit more consistent results: |
* main: lib/db: Update global meta even if unchanged (fixes syncthing#6850) (syncthing#6852)
|
Retesting this it now actually works for me. I don't know if this is because the cache changes or if I did something wrong last time or something is flaky. I'll however run it some more with the assumption that it's all good and get into some actual review from my side :) |
|
I added a benchmark to do a scanner-like walk (first walk the filesystem, then stat each entry as if we already had them in the database); One "op" here is a complete double-walk over a 10k files fakefs. There's more than 10k things looked at because there's a directory structure based on the random file names, so somewhere between 10k and 30k actual filesystem entries in total. The "/entry" numbers are per such filesystem entry. So this adds about 600 bytes and 4000 ns overhead to each entry inspected. The 4000 ns is about a factor two of the non-CaseFS benchmark, but we should keep in mind that this is doing zero actual I/O or hashing or database operations so we are measuring just FakeFS overhead vs FakeFS+CaseFS overhead. I think we're good here, performance wise. |
| return out, nil | ||
| } | ||
|
|
||
| func (r *defaultRealCaser) startCaseResetTimerLocked() { |
There was a problem hiding this comment.
This thing could be slightly simplified by not using a timer and a routine for the reset, instead recording the creation time of the cache. If it's too old or too large on entry into realCase we drop the cache. The downside would be that a cache is not automatically expired when we stop calling realCase -- it would stick around until next call. A workaround for that could be a permanent ticker routine that once every few seconds checks if the cache is expired and removes it. This is similar to what happens now except there would be a permanent routine and ticker instead of the selects and stuff.
I don't think the current implementation is necessarily bad, but it is a few things to take in.
There was a problem hiding this comment.
I avoided a persistent goroutine because a filesystem never gets closed, thus we'd leak a goroutine every time a filesystem is (re-)created.
https://github.com/syncthing/syncthing/wiki/Filesystem-Case-Sensitivity#detect-real-case-proposal