CSCI-UA.0202 Spring 2015 Homework 9

Handed out Friday, April 24, 2015
Due 10:00 AM, Friday, May 1, 2015

Homework 9

These problems should be done on your own. We're not going to be grading them strictly (we'll mainly look at whether you attempted them). But they will be reinforcing knowledge and skills, so you should totally work through them carefully.

NFS

  1. The network file system (NFS) protocol provides reliability via which of the following? Justify your answer.
    * at-most-once semantics
    * at-least-once semantics
    * two-phase commit
    * transactions


  2. The NFS authors had a goal of transparency. They wanted applications to be unable to distinguish whether a file system was (a) a remote file system served from an NFS server; or (b) a typical, local Unix file system. They did not succeed. (In fact, their goal was impossible.) State precisely one way in which application code can experience different behavior when interacting with a remote NFS file system versus a local Unix file system. Your answer should be in terms of what application code sees (rather than in terms of what a global observer sees). Furthermore, please give the reason why it was impossible to provide transparency for the use case you stated.

Transactions

In class, we saw that a key component for implementing transactions with atomicity (which we sometimes called “all-or-nothing atomicity”) was a logging protocol plus a recovery protocol. This question will ask you to adjust the logging protocol. Recall that the system assumes (a) an on-disk log and (b) separate on-disk data structures (such as a database’s tables), known as stable storage. The log protocol includes several record types, all of which include a transaction identifier: The logging protocol enforces two invariants: Finally, recall that recovery after a crash is a two-pass process: the system scans backwards from the end of the log, undoing some changes, and then scans forwards, redoing some changes.
  1. What modification or addition to the invariants above could we make so that recovery could consist of only a single undo pass?
  2. What modification or addition to the invariants above could we make so that recovery could consist of only a single redo pass?

Two-phase Commit

  1. Consider the following statement: "If machines were guaranteed not to crash, we would not need two-phase commit: the coordinator could, in one phase, decide whether a distributed transaction would commit, and then instruct the workers to apply their piece of the transaction."
    Is the above statement true or false? Justify your answer.

  2. In two-phase commit, suppose the coordinator fails after writing "COMMIT" to disk and sending "COMMIT" to all participating nodes but before any of the nodes receive this message. Suppose that the "COMMIT" message reaches i of the n participants and that the participants implement a protocol in which they communicate with one another when they suspect that the coordinator has failed.
    What is the minimum number of participants that must receive the "COMMIT" message to allow the participants to complete the transaction without waiting for the coordinator to recover?

Virtual Memory

For the statements below, please state whether they are true Always, Sometimes, or Never. Justify each answer.
  1. "On the x86, if a given memory reference (load or store) causes a page fault exception, then that memory reference also causes a TLB miss."
  2. "On the x86, if a given memory reference from user mode results in a TLB miss, then the memory reference also causes a page fault."
  3. "On the x86, if a given memory reference from kernel mode results in a TLB miss, then the memory reference also causes a page fault."
  4. "On the x86, if a page table entry's PTE_P and PTE_U bits are set, then it is permissible for the process to load from the corresponding virtual address."
  5. "On the x86, if a page table entry's PTE_P and PTE_U bits are set, then it is permissible for the process to store to the corresponding virtual address."

Threads & Processes

On Linux, why are threads sometimes called "lightweight processes"?

Handing in the homework

Use NYU Classes; there's an entry for this homework.


Last updated: Mon May 04 11:24:46 -0400 2015 [validate xhtml]