Recent Post

Input/Output Hardware and Magnetic Disk

Stable Storage
  • RAIDS can protect against sectors going bad
  • Can't protect against write operations spitting out garbage or crashes during writes
  • Stable storage: either correct data is laid down or old data remains in place
  • Necessary for some apps-data can't be lost or go bad
Assumptions
  • Can detect a bad write on subsequent reads via ECC (Error Correction Code)
  • Probability of having bad data in sector on two different disk is negligible
  • If CPU fails, it stops along with any write in progress at the time.Bad data can be detected later via ECC during read operation
The idea and the operations
  • Use 2 identical disks-do the same thing to both disks
  • Use 3 operations
Stable writ
  1. First write, then read back and compare.
  2. If they are the same write to second disk.
  3. If write fails, try up to n times to get it to succeed.
        After n failures keep using spare sectors until it succeeds. Then go to disk 2. 


Stable read
  • read from disk 1 n times until get a good ECC, otherwise read from disk 2 (assumption that probability of both sectors being bad is negligible)
Crash recovery
  • read both copies of blocks and compare them. If one block has an ECC error, overwrite it with the good block. If both pass the ECC test, then pick either
CPU Crashes

 (a) Crash happens before write
 (b) Crash happens during write to 1
 (c) Crash happens after 1 but before 2
 (d) During 2, after 1
 (e) Both are the same

No comments