[OpenAFS-devel] Forcing fetches from the server side bypassing the client cache
Christos Ricudis
ricudis@itc.auth.gr
Thu, 12 Dec 2002 23:06:02 +0200
Dear AFS developers,.
I'm working on a file access logging project which involves logging read
accesses to an AFS filesystem.
Basically, what I'm doing is :
I keep a list of FID's, which are read by the fileserver process
upon start, and kept in a hash table.
In SRXAFS_FetchData, I look up the FID in the hash table, and if found,
I log an event in an external logging system
The system works fine as long as the file in question is not cached in
the client's cache. So I need a server-driven way to invalidate the
client cache for specific FIDs. (I know about performance impact
implications of bypassing the cache and I'm not concerned with them
now).
Following earlier suggestions in this list, I tried to modify
the callback timeout values returned by SRXAFS_FetchData,
by passing a small relative value to SetCallBackStruct call
(I just add a small constant to FT_ApproxTime() in the
relevant part of AddCallBack_r logic and return this as a timeout
value).
This doesn't seem to work - the file is STILL cached in the client side
cache after the callback timeout has passed.
I noticed that the client cache logic is looking at the DataVersion
field in the vnode (forcing a refetch in the case of a mismatch), which
gets updated in the server side when the vnode is modified. I tried to
artificially bump the DataVersion return value before returning
OutStatus to the client - that still didn't worked as I expected.
Another approach would be to put a server thread traverse the callback
list at specified time intervals and break callbacks for the specific
FID in question (didn't tried this yet, though)
Am I doing something fundamentally wrong? Is there another way to FORCE
a client refetch on the server side?
Thank you very much
(please CC: me any replies - thanks)
--
Christos Ricudis ricudis@itc.auth.gr
Systems Administrator +30-310-998305
IT Support Center
Aristotles University of Thessaloniki, GREECE