-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
chore(fs): only cache the cache for case FS, not the entire FS #9701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Not sure if this is really |
lib/fs/casefs.go
Outdated
| } | ||
|
|
||
| func newDefaultRealCaser(fs Filesystem) *defaultRealCaser { | ||
| type caseCache = *lru.TwoQueueCache[string, *caseNode] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This confused me up until reading this line, because the map[fskey]caseCache looks like a map of something not-pointer-shaped, and yet here we are with a pointer. I think I'd prefer the alias to not include the pointer star, and have that be visible at the places it's used instead...
calmh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reasonable, apart from clarity complaint
3c64a68 to
86ca6ea
Compare
This would have addressed a recent issue that arose when re-ordering our "filesystem layers". Specifically moving the caseFilesystem to the outermost layer. The previous cache included the filesystem, and as such all the layers below. This isn't desirable (to put it mildly), as you can create different variants of filesystems with different layers for the same path and options. Concretely this did happen with the mtime layer, which isn't always present. A test for the mtime related breakage was added in syncthing#9687, and I intend to redo the caseFilesystem reordering after this. Ref: syncthing#9677 Followup to: syncthing#9687
86ca6ea to
3297e86
Compare
calmh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right on
…hing#9701) This would have addressed a recent issue that arose when re-ordering our "filesystem layers". Specifically moving the caseFilesystem to the outermost layer. The previous cache included the filesystem, and as such all the layers below. This isn't desirable (to put it mildly), as you can create different variants of filesystems with different layers for the same path and options. Concretely this did happen with the mtime layer, which isn't always present. A test for the mtime related breakage was added in syncthing#9687, and I intend to redo the caseFilesystem reordering after this. Ref: syncthing#9677 Followup to: syncthing#9687
syncthing#9701)" This reverts commit ac8b334.
In syncthing#9701 there was a semi-unrelated change to bind the `getExpireAdd` mutex and `getExpireAdd` itself to `defaultRealCaser`, instead of `caseCache`. This is erroneous because multiple `defaultRealCaser`s can share the same `caseCache`. Signed-off-by: Marcus B Spencer <marcus@marcusspencer.us>
) In #9701 there was a change that put the mutex used for `getExpireAdd` directly in `defaultRealCaser`, which is erroneous because multiple filesystems can share the same `caseCache`. ### Purpose Fixes #9836 and [Slow sync sending files from Android](https://forum.syncthing.net/t/slow-sync-sending-files-from-android/24208?u=marbens). There may be other issues caused by `getExpireAdd` conflicting with itself, though. ### Testing Unit tests pass and the case cache and conflict detection _seem_ to behave correctly. Signed-off-by: Marcus B Spencer <marcus@marcusspencer.us>
This would have addressed a recent issue that arose when re-ordering our "filesystem layers". Specifically moving the caseFilesystem to the outermost layer. The previous cache included the filesystem, and as such all the layers below. This isn't desirable (to put it mildly), as you can create different variants of filesystems with different layers for the same path and options. Concretely this did happen with the mtime layer, which isn't always present. A test for the mtime related breakage was added in #9687, and I intend to redo the caseFilesystem reordering after this.
Ref: #9677
Followup to: #9687