> > If I'm doing tail -f on a remote log file and tail -f > just does occasional reads at the end of the file, > then you will get the wrong answer, because once > the cache sees the eof it will never issue another > read.
If the file is "decent", the cache must still check out that the file is up to date. It might not do so all the times (as we do, to trade for performance, as you say). That means that the cache would get further file data as soon as it sees a new qid.vers for the file. And tail -f would still work. However, for some indecent files ;), the cache may have problems even if it trusts the file length as reported by the server or the qid.vers. QTAPPEND is indeed something that says that file is weird, QTCL would just signal the general case, not just a +a file. I can do a quick experiment using Op just to see if by faking up some QTCTLs in the Op server, the client may work with all files, even clone ones. And see what happens. I´m not seeking for coherency, I´d just like to be able to cache what I can, (keeping races as they are), to better tolerate latency. thanks a lot for all the comments, btw. > It is a fundamental problem with implementing > caching atop a system that is not intended to be > cached. Having a QTCTL bit (or a QTOKTOCACHE bit) > will not solve the problem. > > Cfs is not magic. It trades some of the reliability > of 9P for some performance. It doesn't do a perfect > job. If you choose to use cfs then you are accepting > those degradations in semantics, even for "disk files". > > What you really need is a way to ask the server "can I > cache the following?" and have the server say yes or no > and then have some way to invalidate the cache, so that > you get coherent behavior, even in the above case. > We discussed various ways to add this to the protocol > but ultimately we didn't see any way that was simple > enough that the specification effort wasn't outweighed > by our not needing to solve the problem at that time. > (We did add QTAPPEND to fix one glaring cfs bug.) > > By all means experiment with real caching protocols > using 9P. Perhaps you will find a nice way to add it > and then 9P2010 can adopt it. QTCTL isn't enough though: > it pushes your problems farther away but doesn't solve them. > > Russ >
