M.I.T. DEPARTMENT OF EECS

6.033 - Computer System Engineering Handout 41 - Issued May 13, 1999


Quiz 3 Solutions

Mean 83.20; Median 85; Std dev 11.47
1. C
2. A,B
3. A, B, C, and D (C can be debated either way, so if you circled
    just A, B, and D, consider your answer right.)
4. A, B
5. A
6. A, B, and D
7. add_log(COMMIT, sequence-1)

We thought that the correct answer was "add_log(COMMIT, sequence -
1)", which received full credit.  However, as one of the students has
pointed out, the right answer is, in fact, "add_log(BEGIN, sequence)".

The way to analyze this question is to replace BEGIN and COMMIT with
F1 and F2, so that the mnemonics don't distract from the semantics.
There are two recoverable things: "sequence" and the transmission of
the CD.  Writing F1 to the log durably records the current value of
"sequence" as intending to be used; no matter what happens after that
point "sequence" will end up set to the current value plus 1 and the
data will be sent.  The recovery procedure merely checks to see
whether or not transfer ever got around to incrementing sequence, and
by the problem statement someone magically continues the BEEP if the
acknowledgement containing the current value of sequence hasn't come
back.

What we have here is an intentions-list log, in which F1 is the
COMMIT; F2 is the completion note.  The recovery procedure knows the
only variable that can change, so it wasn't necessary to record its
change in the log.

8. A.
9. A, B
10. A
11. A, B, and D
12. 
    add_log(BEGIN, h.seq); 
    add_log(COMMIT, h.seq)
or 
    add_log(BEGIN, nextSequence); 
    add_log(COMMIT, nextSequence - 1);
13. D.
14. C
15. C, F, and H
16. B
Go to 6.033 Home Page Questions or Comments: 6.033-tas@mit.edu