-
Notifications
You must be signed in to change notification settings - Fork 37
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
flatfile rename issue #358
Comments
There is a check for this that can produce mlogs like: MLOG ERR FlatFile: openfile rename across devs that David S. saw from the regression test. |
Thx John
|
Ah, there's that too. Looking at the current code, i think that if you write during the copy the write data will be copied only if the Util::CopyFile hasn't done that area. Could add more locking code to block the writes during copy, though currently it isn't a common use case for us. |
for the flat file FS: if we have an open file and we rename it, the flatfile code may copy the backing file from one backing filesystem to another (e.g. see FlatFileSystem::rename() calls Util::CopyFile). if the file is open we have a cached IOSHandle *backend_fh in the Flat_fd ... and if Flat_fd::renamefd() is called (see FlatFileFD.h), it will update the path/backend metadata in the Flat_fd, but not the open backend_fh IOSHandle (which will point to the old backend filesystem, pre Util::CopyFile). Future I/O will go to that stale backend_fh, rather than a new fh open on the new backend location.
This only impacts FUSE (since it is the main user of renamefd()).
A possible solution is to have Flat_fd::renamefd() close the old backend_fh and reopen the backing file at the new location (making sure you open in the correct mode and get the error handling right).
The text was updated successfully, but these errors were encountered: