update gerrit list
[openafs-wiki.git] / diagrams / afs-cb-story.mdwn
1 # Create file
2
3 ![afs-cb-0][1]
4
5 1. create file on **host d**
6  * data version **(dv) = 1**
7  * callback registration
8 2. read on **hosts a,b,c**
9 3. fetch-states
10 4. add callback at fileserver
11
12 # Replicate file
13
14 ![afs-cb-1][2]
15
16 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.
17
18 # Modify file
19
20 ![afs-cb-2][3]
21
22 host a modifies the file.
23
24 1. open, write, close on **host a**
25 2. store-data
26 3. callbacks **b,c,d** are called
27  * "break" callbacks once called (i.e. remove them from the table once called)
28 4. reply **dv=2** for **host a**
29  * incremented at the **fileserver**
30
31 # Read stale file
32
33 ![afs-cb-3][4]
34
35 read a stale file on **host c**.
36
37 1. open, read on **host c**
38 2. fetch-status
39  * returns **dv=2** > local cached **dv=1**
40 3. fetch-data **dv=2** for **host c**
41  * registers callback for the file on **host c**
42
43 # Callback expires
44
45 ![afs-cb-4][5]
46
47 1. callbacks **a,c** expire.
48 2. read file on **host c**
49 3. fetch-status
50  * returns **dv=2** == local cached **dv**
51  * registers a new callback for the file on **host c** with **fileserver**
52 4. new callback. cached data so local data is used.
53
54 # Callback failure
55
56 ![afs-cb-5][6]
57
58 a common failure mode: callback to host fails
59
60 1. write, close on **host a**
61 2. store-data
62 3. callback (fails)
63 4. store-data reply
64  * **fileserver** increments **dv=3**
65 5. delayed callback (fails until it does not)
66 6. callback expires (read fails)
67
68 [1]: /diagrams/afs-cb-0.png "Create file"
69 [2]: /diagrams/afs-cb-1.png "Replicate file"
70 [3]: /diagrams/afs-cb-2.png "Modify file"
71 [4]: /diagrams/afs-cb-3.png "Read stale file"
72 [5]: /diagrams/afs-cb-4.png "Callback expires"
73 [6]: /diagrams/afs-cb-5.png "Callback failure"