The keyboard of Per-Ola Mard emitted at some point in time:
> 
> Hello AFS world,
> 
> Is there someone out there that can sched some light over the fact
> that echo -n "" will cause/force a callback, while perl open/close will
> not?

     echo -n "" >>file 

Will append a null string to the file (which should leave it as it is)
in the process updating the stat record.

     touch file

Should do the same, but AFS addressed that specifically to stop people
causing a lot of network traffic with touch.

My guess is that perl optimises the access, doing a stat read for 
the open, and waiting until actual output appears before opening 
for writing.

The kernel may similarly optimise the physical write away if the info in
the relevant block has not changed, in particular where file IO is done 
via the paging mechanism this is easy to ascertain - page is still clean.
The kernel should still update the mtime in the inode, but it may well be
that AFS drops the call-back if only the stat record has changed. This
would also affect echo,

Looking at your explanation, it would probably better if you wrote actual
short messages to the files instead of weaseling the system into doing
something for you by going for the stat records - yes, there is an overhead
as those files have to be cleared and broadcast. Otherwise, use streams,
your application will then even be portable, even though a bit more work
in the first place.

> 
> Where lies the difference? I am making the perl program flush buffers
> and all that, but the changed file is showing up only in the same cache
> as where the program is writing to the file, all other caches is
> [!happily] unaware of the change. Anyone willing to share some perl
> secrets or anything? What is AFS looking for? Is it change of mtime that
> cause the callback to be made? What is the rule for doing the callback?

                                Thomas

*   Why not use metric units and get it right first time, every time ?
*
*   email: cmaae47 @ imperial.ac.uk
*   voice: +44 171 594 7076 (day)
*   fax:   +44 171 584 1560
*   snail: Thomas Sippel - Dau
*          Information Services Manager
*          Center of Vibration Engineering
*          Imperial College of Science, Technology and Medicine
*          Exhibition Road
*          Kensington SW7 2BX
*          Great Britain

Reply via email to