9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] QTCTL?
Date: Thu,  1 Nov 2007 10:38:22 -0400	[thread overview]
Message-ID: <914d0489b3dee458eceaf94593dbc71d@quanstro.net> (raw)
In-Reply-To: <20071101142849.BA1A61E8C4C@holo.morphisms.net>

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

i haven't thought this through, but perhaps this would
be an easier problem if we didn't change 9p, but we changed
the model of the caching server.

the current proposals assume that the caching servers don't
know that other caches are out there.  alternatively,
the caching servers participate in a coherency protocol with
9p clients none-the-wiser.

- erik

[-- Attachment #2: Type: message/rfc822, Size: 6133 bytes --]

From: "Russ Cox" <rsc@swtch.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] QTCTL?
Date: Thu, 1 Nov 2007 10:28:48 -0400
Message-ID: <20071101142849.BA1A61E8C4C@holo.morphisms.net>

> Do you recall what the issues were?

The main proposal I remember was to give out read and write
tokens and then revoke them as appropriate.  The two big problems
with this were that it meant having spontaneous server->client->server
message exchange instead of the usual client->server->client
(a very large semantic break with existing 9P) and that once you
had granted a read token to a client the client could simply stop
responding (acknowledging the revocation) and slow down the
rest of the system.

I think that an ideal caching solution would have the following
properties.

1. For 9P servers that don't care to let their files be cached,
the effort in doing so should be minimal.  For example, perhaps
servers would simply respond to a Tcache message with Rerror,
like non-authenticating servers respond to Tauth with Rerror.
Anything more is not going to get implemented.

2. All 9P messages would still be client->server->client.
This fits with #1, but also excludes solutions that introduce
new server->client->server messages after a successful Tcache.

3. If a client that is caching some data stops responding, the rest
of the system can continue to function without it: slow clients
don't slow the entire system.

4. Except for timing, the cached behavior is identical to what 
you'd see in an uncached setting, not some relaxed semantics.
For example, suppose you adopted a model where each server
response could have some cache invalidations piggybacked on it.
This would provide a weak but precise consistency model in that
any cached behaviors observed interacting with that server
would be the same as shifting uncached behavior back in time a bit.
It could be made to appear that the machine was just a few seconds
behind the server, but otherwise fully consistent.  The problem with
this is when multiple machines are involved, and since Plan 9 is
a networked system, this happens.  For example, a common setup
is for one machine to spool mail into /mail/queue and then run
rx to another machine to kick the queue processor (the mail sender).
If the other machine is behaving like it's 5 seconds behind, then it
won't see the mail that just got spooled, making the rx kick worthless.

5. It is easy to get right.

#1 is trivial.  #2 and #3 are difficult and point to some kind of 
lease-based solution instead of tokens.  

#4 keeps us honest: weakened consistency like in my example
or in cfs(4) or in recover(4) might occasionally be useful, but it
will break important and subtle real-world cases and make the
system a lot more fragile.  If you pile up enough things that only
work 99% of the time, you very quickly end up with a crappy system.
(If that's what you want, might I suggest Linux?)

#5 is probably wishful thinking on my part.

> Wouldn't something like load-linked/store-conditional suffice
> if the common case is a single writer?  When the client does
> a "read-linked" call, the server sends an ID along with the
> data. The client can then do a "write-conditional" by passing
> the original ID and new data.  If the ID is not valid anymore
> (if someone else wrote in the meantime) the write fails.  The
> server doesn't have to keep any client state or inform anyone
> about an invalid cache.  Of course, if any client fails to
> follow this protocol things fall apart but at least well
> behaved clients can get coherency. And this would work for
> cases such as making changes on a disconnected laptop and
> resyncing to the main server on the next connect.  You
> wouldn't use this for synthetic files.  This ID can be as
> simple as a file "generation" number incremented on each
> write or crypto strong checksum.

This doesn't solve the problem of one client caching the file
contents and another writing to the file; how does the first
find out that the file has changed before it uses the cached 
contents again?

Russ

  reply	other threads:[~2007-11-01 14:38 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31 18:40 Francisco J Ballesteros
2007-10-31 18:56 ` Eric Van Hensbergen
2007-10-31 19:13   ` Charles Forsyth
2007-10-31 19:33     ` Eric Van Hensbergen
2007-10-31 19:39       ` erik quanstrom
2007-10-31 20:43     ` geoff
2007-10-31 21:32       ` Charles Forsyth
2007-10-31 22:48       ` roger peppe
2007-10-31 23:35         ` erik quanstrom
2007-11-01  9:29           ` roger peppe
2007-11-01 11:03             ` Eric Van Hensbergen
2007-11-01 11:19               ` Charles Forsyth
2007-11-01 12:11             ` erik quanstrom
2007-10-31 19:42 ` erik quanstrom
2007-10-31 19:49   ` Eric Van Hensbergen
2007-10-31 20:03     ` erik quanstrom
2007-10-31 20:10       ` Latchesar Ionkov
2007-10-31 20:12       ` Eric Van Hensbergen
2007-10-31 20:17       ` Russ Cox
2007-10-31 20:29         ` Francisco J Ballesteros
2007-10-31 20:48           ` Charles Forsyth
2007-10-31 21:23             ` Francisco J Ballesteros
2007-10-31 21:40               ` Russ Cox
2007-10-31 22:11                 ` Charles Forsyth
2007-10-31 22:26                 ` Francisco J Ballesteros
2007-10-31 22:37                   ` Charles Forsyth
2007-10-31 22:43                     ` Francisco J Ballesteros
2007-10-31 23:32                     ` Eric Van Hensbergen
2007-10-31 23:41                       ` [V9fs-developer] " Charles Forsyth
     [not found]                       ` <606b6f003ae9f0ed3e8c3c5f90ddc720@terzarima.net>
2007-11-01  1:13                         ` Eric Van Hensbergen
2007-10-31 23:54                   ` erik quanstrom
2007-11-01  0:03                     ` Charles Forsyth
2007-11-01  1:25                     ` Eric Van Hensbergen
2007-11-01  1:44                       ` erik quanstrom
2007-11-01  2:15                         ` Eric Van Hensbergen
2007-11-01  7:34                       ` Skip Tavakkolian
2007-11-01  6:21                 ` Bakul Shah
2007-11-01 14:28                   ` Russ Cox
2007-11-01 14:38                     ` erik quanstrom [this message]
2007-11-01 14:41                     ` Charles Forsyth
2007-11-01 15:26                     ` Sape Mullender
2007-11-01 15:51                       ` Latchesar Ionkov
2007-11-01 16:04                         ` ron minnich
2007-11-01 16:16                           ` Latchesar Ionkov
2007-11-01 16:21                           ` Sape Mullender
2007-11-01 16:58                             ` Francisco J Ballesteros
2007-11-01 17:11                               ` Charles Forsyth
2007-11-01 17:11                                 ` Francisco J Ballesteros
2007-11-01 17:13                               ` Sape Mullender
2007-11-01 17:38                               ` ron minnich
2007-11-01 17:56                                 ` Francisco J Ballesteros
2007-11-01 18:01                                   ` Francisco J Ballesteros
2007-11-01 18:52                                   ` Eric Van Hensbergen
2007-11-01 19:29                                     ` Francisco J Ballesteros
2007-11-01 23:24                                   ` ron minnich
2007-11-01 17:03                           ` Russ Cox
2007-11-01 17:12                             ` Sape Mullender
2007-11-01 17:35                               ` erik quanstrom
2007-11-01 18:36                                 ` erik quanstrom
2007-11-01 17:13                             ` Charles Forsyth
2007-11-01 17:16                               ` Charles Forsyth
2007-11-01 17:20                                 ` Charles Forsyth
2007-11-01 17:52                             ` Eric Van Hensbergen
2007-11-01 18:00                             ` Latchesar Ionkov
2007-11-01 18:03                               ` Francisco J Ballesteros
2007-11-01 18:08                                 ` Latchesar Ionkov
2007-11-01 18:16                                   ` erik quanstrom
2007-11-01 18:19                                   ` Francisco J Ballesteros
2007-11-01 18:35                                     ` Sape Mullender
2007-11-01 19:09                                       ` Charles Forsyth
2007-11-01 19:07                                         ` erik quanstrom
2007-11-01 17:14                           ` Bakul Shah
2007-11-01 16:17                         ` Sape Mullender
2007-11-01 16:27                           ` Sape Mullender
2007-11-01 16:58                         ` Sape Mullender
2007-11-01 16:59                     ` Bakul Shah
2007-11-01  4:21 Brian L. Stuart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=914d0489b3dee458eceaf94593dbc71d@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).