[Gluster-users] Coherency problem with file buffer cache

Brian Foster 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:

http://thread.gmane.org/gmane.comp.file-systems.fuse.devel/11589

- 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.

Brian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fuse-update-attributes-on-aio_read.patch
Type: text/x-patch
Size: 1579 bytes
Desc: not available
URL: <http://supercolony.gluster.org/pipermail/gluster-users/attachments/20120613/85b66306/attachment.bin>


More information about the Gluster-users mailing list