From 0b153daa6840258581deacb29d3d4c0f8d88f8b1 Mon Sep 17 00:00:00 2001 From: Joe Gorse Date: Thu, 25 Aug 2016 13:50:53 -0400 Subject: [PATCH 1/1] AFS callback story for reads and writes from multiple clients and one fileserver --- diagrams/afs-cb-story.mdwn | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 diagrams/afs-cb-story.mdwn diff --git a/diagrams/afs-cb-story.mdwn b/diagrams/afs-cb-story.mdwn new file mode 100644 index 0000000..ba01d1f --- /dev/null +++ b/diagrams/afs-cb-story.mdwn @@ -0,0 +1,52 @@ +[afs-cb-0][1] +1. create file on *host d* + * data version (dv) = 1 + * callback registration +2. read on *hosts a,b,c* +3. fetch-states +4. add callback at fileserver + +![afs-cb-1][2] +hello.c propagates to *hosts a,b,c* from fileserver. Callbacks are registered for a period of time. Callbacks notify a host if a change occurs. + +[afs-cb-2][3] +host a modifies the file. +1. open, write, close on *host a* +2. store-data +3. callbacks *b,c,d* are called + * "break" callbacks once called (i.e. remove them from the table once called) +4. reply *dv=2* for *host a* + * incremented at the *fileserver* + +![afs-cb-3][4] +read a stale file on *host c*. +1. open, read on *host c* +2. fetch-status + * returns *dv=2* > local cached *dv=1* +3. fetch-data *dv=2* for *host c* + * registers callback for the file on *host c* + +[afs-cb-4][5] +1. callbacks *a,c* expire. +2. read file on *host c* +3. fetch-status + * returns *dv=2* == local cached *dv* + * registers a new callback for the file on *host c* with *fileserver* +4. new callback. cached data so local data is used. + +![afs-cb-5][6] +a common failure mode: callback to host fails +1. write, close on *host a* +2. store-data +3. callback (fails) +4. store-data reply + * *fileserver* increments *dv=3* +5. delayed callback (fails until it does not) +6. callback expires (read fails) + +[1]: /diagrams/afs-cb-0.png "Create file" +[2]: /diagrams/afs-cb-1.png "Replicate file" +[3]: /diagrams/afs-cb-2.png "Modify file" +[4]: /diagrams/afs-cb-3.png "Read stale file" +[5]: /diagrams/afs-cb-4.png "Callback expires" +[6]: /diagrams/afs-cb-5.png "Callback failure" -- 1.9.4