5 1. create file on **host d**
6 * data version **(dv) = 1**
7 * callback registration
8 2. read on **hosts a,b,c**
10 4. add callback at fileserver
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.
22 host a modifies the file.
24 1. open, write, close on **host a**
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**
35 read a stale file on **host c**.
37 1. open, read on **host c**
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**
47 1. callbacks **a,c** expire.
48 2. read file on **host c**
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.
58 a common failure mode: callback to host fails
60 1. write, close on **host a**
64 * **fileserver** increments **dv=3**
65 5. delayed callback (fails until it does not)
66 6. callback expires (read fails)
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"