How
Read
What are the steps when client C wants to read a file?
- C sends filename and offset to coordinator (CO) (if not cached) CO has a filename → array-of-chunkhandle table and a chunkhandle → list-of-chunkservers table
- CO finds chunk handle for that offset
- CO replies with chunkhandle + list of chunkservers
- C caches handle + chunkserver list
- C sends request to nearest chunkserver chunk handle, offset
- chunk server reads from chunk file on disk, returns to client
Write
What are the steps when C wants to write a file at some offset? paper’s Figure 2
- C asks CO about file’s chunk @ offset
- CO tells C the primary and secondaries
- C sends data to all (just temporary…), waits for all replies (?)
- C asks P to write
- P checks that lease hasn’t expired
- P writes its own chunk file (a Linux file)
- P tells each secondary to write (copy temporary into chunk file)
- P waits for all secondaries to reply, or timeout secondary can reply “error” e.g. out of disk space
- P tells C “ok” or “error”
- C retries from start if error