-
Notifications
You must be signed in to change notification settings - Fork 74
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
Some Write calls leads to data loss #113
Comments
What I find interesting is that for a given |
Checking the logs points to another "expected fileid... fileid changed" error. Specifically, I get a lot of lines with the following |
Are you seeing file handles expiring? / being re-established? I wonder if fileid instability is downstream of handle instability here? |
Are fileid separate from handles (ie, are they handled by the implementation, not the server)? |
It is filled in by the server if not provided by the implementation: https://github.com/willscott/go-nfs/blob/master/file.go#L112-L122 If the underlying files are |
It's technically possible to get a different inode than expected if you move a directory (since the path will be different), but I don't think that's what's happening here. |
What file does |
|
No, I'm trying to match the |
I don't know which part of the journalctl you're seeing that in.- journalctl may be showing either NFS handles, file system inodes, or something else like an error code. |
If you grep for |
Ok, got it --- the fileids are referring to the implementation's fileid/inodes. In my case, |
Interestingly, when it says |
foo ( the 0x1) is likely the internal identifier the client is using to identify a file, |
So shouldn't it almost always be mismatched? |
Actually, I think the "expected fileid" problem is unrelated --- I think I solved the problem on my side (the error is no longer showing up in my logs), but the original error still remains. |
To dive deeper into the original symptoms:
|
|
I was going to check if |
I sometimes get Looking online points to some issue with |
Ok, here's something interesting --- if I disable ReadDirPlus with |
Similarly, for the |
Apparently, the This can be replicated by running a failing #include <unistd.h>
#include <stdio.h>
#include <limits.h>
int main() {
char cwd[PATH_MAX];
if (getcwd(cwd, sizeof(cwd)) != NULL) {
printf("%s\n", cwd);
} else {
perror("getcwd() error");
return 1;
}
return 0;
} |
Interestingly, |
I see the problem --- Of course, this doesn't explain why going out of the current directory, then going back fixes the problem --- for some reason, it "regenerates" the folder. |
I'm looking at bazil/fuse#250, and it looks like the main problem is that each Lookup returns a new handle, so previous ones get invalidated. I made a quick POC that seems to fix the issue by just keeping a map between the path and a handle and using it if it already exists. |
Yeah, I just confirmed by making handles one-to-one (and not only unique), the problems (both the |
The main problem is that since the keys are strings, you can only cache on path, not filesystem --- you could get around this by mapping to a list of lists, where the first element is the filesystem and the second is the list of bytes. |
|
Done in #116. |
In some cases (eg, when cloning a moderately big repository, like this one), data written to a file can not be read back in a
pread
call (ie, will return 0 bytes).The text was updated successfully, but these errors were encountered: