[Gluster-users] Coherency problem with file buffer cache
bfoster at redhat.com
Wed Jun 13 15:41:07 UTC 2012
On 06/13/2012 03:02 AM, Sabyasachi Ruj wrote:
>> So maybe the time when you gain an exclusive lock on a file is the
>> appropriate time to flush your local cache?
> I used exclusive lock is just for a simplified demonstration. In
> reality, a shared read lock will be used when just reading from the
> file is enough. I that case, the right time to flush local cache would
> be whenever any *lock* is obtained.
FWIW, here are a couple fuse patches that allow your test program to work:
- The first has been posted upstream and fixes an issue where fuse
wouldn't invalidate cache of a file unless the file size has changed:
- The second I just cooked up to always invoke the revalidation in the
read path. It currently only revalidates if a read is attempted beyond
EOF (to ensure the size attribute is valid). I've only lightly tested so
far to see how it behaves with your test. The patch is attached. Note
that AFAICS this would still be a problem when using splice.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1579 bytes
Desc: not available
More information about the Gluster-users