mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[GH-ISSUE #1355] Why do we use fdent_data_lock #729
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#729
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lwpdsg on GitHub (Aug 10, 2020).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1355
Hi, When I testing s3fs_fuse I found the fuse has control the parallel operation of the same file .That means I can't read the file while somebody is writing it, seems like all parallel operation I made to same file will transfer to sequential function call when passing fuse. For instance, I add 10 secs's sleep in s3fs read then try to do some parallel read using multiple shell windows, when the process sleeps at the code I added, I used pstack to output the functions stacks . And there is only one s3fs_read, the next will be called after the current one was finished. so I am confused with these fdent_data_locks , what's the function of them ?
@gaul commented on GitHub (Aug 11, 2020):
fdent_data_lockprotects several members includingpagelistusing a simple per-fd lock. Previously there was a single lock for metadata and data for each fd which blocked alsostatandreaddirduring uploads, #928. There are more complicated locking strategies, e.g., byte ranges, although we have not implemented those yet due to their complexity. One easier approach would be using a multi-reader, single-writer lock although this needs to make sure that s3fs does not download the same range concurrently, among other things.@lwpdsg commented on GitHub (Aug 13, 2020):
Thank you for your reply. I know there are two mutexes in the fdentity , the fdent_lock controls the metadata like fd, orgmeta. the other one which is fdent_data_lock controls the pagelist and data to limit concurrent reading/writing of the same file. But the question is fuse doesn't allow reading or writing the same file concurrently. Among our test , we try to read one file in multithreads. As expetced, one thread can get the fdent_data_lock in FdEntity::Read and return the data , all the others should block at somewhere like FdEntity::Open or FdEntity::Read while trying to get the fdent_data_lock. But the output of the pstack shows only one thread processed in s3fs_read,the fuse blocks the other thread of reading. So the fdent_data_lock seems useless since there won't be two threads operating the data of the file concurrently . Please let me know if anying I misunderstand, THX