Crash Consistency and the Journal · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Writing the intent before the blocks

Computing · Computer Systems · ages 20-22
Name ______________________   Date ____________
  1. A file move crashes halfway. Which broken outcome is possible?

    • A faster computer
    • The file in both folders, or in neither
    • Free extra disk space
  2. Why is a crash mid-operation dangerous?

    • It leaves a state no correct sequence could produce
    • It makes the disk spin faster
    • It renames all users
  3. What does the journal store before the real blocks?

    • User passwords
    • Movie files
    • The intention, then a commit record
  4. Recovery finds a journal entry with a commit record. What does it do?

    • Finishes the operation by replaying it
    • Discards the disk
    • Asks the user to reboot twice
  5. Why must the journal entry precede the real writes?

    • So disks spin less
    • So recovery can finish or discard the whole operation
    • So users type faster
  6. Recovery discards a journal entry that has no commit record.

    Circle one:   True   False

  7. Replaying a committed move can duplicate the file.

    Circle one:   True   False

  8. A designer writes real blocks first and journals after for speed. What is wrong?

    • Nothing, order never matters
    • A crash leaves real changes with no intent record, so recovery cannot judge them
    • Journals forbid speed
LightMySky · lightmysky.comW1-mt_I9DT0TUmiu-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Writing the intent before the blocks W1-mt_I9DT0TUmiu-s1

  1. The file in both folders, or in neither · One half applied without the other gives both or neither.
  2. It leaves a state no correct sequence could produce · Partial writes match no clean before-or-after state.
  3. The intention, then a commit record · Intent comes first so recovery knows the plan.
  4. Finishes the operation by replaying it · Commit means the operation was whole, so replay completes it.
  5. So recovery can finish or discard the whole operation · A prior intent record is what makes replay or drop possible.
  6. True · Uncommitted means incomplete, so drop it whole.
  7. False · Replay finishes the one intended move, ending with a single file.
  8. A crash leaves real changes with no intent record, so recovery cannot judge them · Intent must precede reality, or recovery has nothing to trust.
Worksheet · LightMySky