






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







it will hold your data until you explicitly delete it (and sometimes even beyond that: backup/restore)
If your data is in main memory, a crash destroys it. Performance tension: need to cache everything. But if so, then crash = lose everything. More fundamental: interesting ops = multiple block modifications, but can only atomically modify disk a sector at a time.
For disk: construct a pair of operations: put(blk, address) : writes data in blk on disk at address get(address) -> blk : returns blk at given disk address such that “put” appears to place data on disk in its entirety or not at all and “get” returns the latest version what we have to guard against: a system crash during a call to “put”, which results in a partial write.
void atomic-put(data) blk atomic-get() version++; # unique integer V1 := get(V1) put(version, V1); D1data := get(D1); put(data, D1); V2 := get(V2); put(version, V2); D2data := get(D2); put(data, D2); if(V1 == V2) return D1data; else return D2data;
cksum( blk ) 45148
45148
void recover(void) { V1data = get(V1); # following 4 ops same as in a-get D1data = get(D1); V2data = get(V2); D2data = get(D2); if (V1data == V2data) if(D1data != D2data)
put(D1data, D2); else
put(D2data, D1);
put(V2data, V1);
Acceptable failures. E.g., the earth is destroyed by aliens from Mars. The loss of a file viewed as unavoidable. Unacceptable failures. E.g. power outage: lost file not ok
+ free list only holds free objects
a new file should have no data blocks, a just allocated block should contain all zeros.
A crash can violate every one of these!