Skip to main content

Storage recovery prediction practice

Attempt before reference code or calibration.

  1. Encode put(a,empty), delete(a), put(a,new). Mark every record boundary and predict state for cuts inside each checksum.
  2. Corrupt the final complete checksum, then truncate its final byte. Explain why the first is rejected and the second returns a recoverable prefix under this policy.
  3. Recover a torn tail, then append a valid record without removing the tail. Show why the appended record may be consumed as part of the incomplete record instead of becoming a new update.
  4. Hand-replay put(a,old), put(b,empty), delete(a). Predict compacted bytes and explain why b remains.
  5. Split that history across two runs. Show the resurrection caused by dropping a deletion from only the newest run.
  6. For your offset index, list offsets before and after compaction. Demonstrate one stale-offset read and the corrected index rebuild.
  7. Draft the publication crash matrix and compute peak old-plus-new bytes. Identify which assumptions require real filesystem verification.

Keep predicted and observed results separately. Add three independent tests: one binary key, one changed compaction scope, and one malformed record. Explain expected rejection versus recoverable tail; do not count every exception as a passing test.