Docsity

Sample Question Set for CS 138: Distributed Systems, Quizzes of Computer Science

Toggle sidebar
bg1
CS 138 Sample Question Set II
Spring 2006
1. Synchronization
(a) Define clock skew and clock drift.
(b) Consider a client that wants to synchronize its clock with a time server. Assume that the client
records three round-trip times when communicating with the server: 10, 15 and 20 msecs. Which of
these values should the client use to set its clock value? Briefly explain why.
2. Fault Tolerance
(a) Describe briefly the fail-stop failure model. What makes the fail-stop model in the case of crash
failures tricky to implement in practice?
3. Distributed Commit
(a) What is the primary goal of distributed commit protocols?
(b) In the Three-Phase Commit Protocol (3PC), if a participant is in the PRE-COMMIT state,
list the states (i) other participants can be in and (ii) the coordinator can be in.
(c) In the Three-Phase Commit Protocol (3PC), if the coordinator is in the PRE-COMMIT state,
list the states that the participants can be in.
4. Quorum Consensus
Consider a quorum-based replicated system consisting of four replicas. The unavailability of a
replica is defined as the probability that the replica is crashed or inaccessible at any given time.
The table below shows the voting configuration and individual unavailabilities of replicas.
Number of Votes
Unavailability
Replica 1 2 0.01
Replica 2 1 0.02
Replica 3 1 0.03
Replica 4 1 0.04
(a) If the read quorum size is 2, then what is the minimum write quorum size?
(b) Assuming a read quorum size of 2 and the minimum write quorum size that you computed
above, compute the blocking probabilities for read and write operations (the blocking
probability of an operation is the probability that an appropriate quorum cannot be
obtained). There is no need to compute the final number; stating the formula is sufficient
5. Replication
(a) Sequential Consistency (i)
P1: R(x)a W(x)b W(x)a R(x)b
P2: R(x)a R(x)b
P3: W(x)b R(x)a R(x)b
Is the above sequence valid for a sequential consistency model? If not, explain why.
(b) Causal Consistency
P1: R(x)a R(x)b W(x)a
P2: R(x)a R(x)b R(x)a W(x)c
P3: R(x)b R(x)a
Is the above sequence valid for a causal consistency model? If not, explain why.
pf2

Partial preview of the text

Download Sample Question Set for CS 138: Distributed Systems and more Quizzes Computer Science in PDF only on Docsity!

CS 138 Sample Question Set II

Spring 2006

  1. Synchronization (a) Define clock skew and clock drift. (b) Consider a client that wants to synchronize its clock with a time server. Assume that the client records three round-trip times when communicating with the server: 10, 15 and 20 msecs. Which of these values should the client use to set its clock value? Briefly explain why.
  2. Fault Tolerance

(a) Describe briefly the fail-stop failure model. What makes the fail-stop model in the case of crash failures tricky to implement in practice?

  1. Distributed Commit (a) What is the primary goal of distributed commit protocols? (b) In the Three-Phase Commit Protocol (3PC), if a participant is in the PRE-COMMIT state, list the states (i) other participants can be in and (ii) the coordinator can be in. (c) In the Three-Phase Commit Protocol (3PC), if the coordinator is in the PRE-COMMIT state, list the states that the participants can be in.
  2. Quorum Consensus Consider a quorum-based replicated system consisting of four replicas. The unavailability of a replica is defined as the probability that the replica is crashed or inaccessible at any given time. The table below shows the voting configuration and individual unavailabilities of replicas.

Number of Votes Unavailability Replica 1 2 0. Replica 2 1 0. Replica 3 1 0. Replica 4 1 0.

(a) If the read quorum size is 2, then what is the minimum write quorum size? (b) Assuming a read quorum size of 2 and the minimum write quorum size that you computed above, compute the blocking probabilities for read and write operations (the blocking probability of an operation is the probability that an appropriate quorum cannot be obtained). There is no need to compute the final number; stating the formula is sufficient

  1. Replication (a) Sequential Consistency (i) P1: R(x)a W(x)b W(x)a R(x)b P2: R(x)a R(x)b P3: W(x)b R(x)a R(x)b Is the above sequence valid for a sequential consistency model? If not, explain why.

(b) Causal Consistency P1: R(x)a R(x)b W(x)a P2: R(x)a R(x)b R(x)a W(x)c P3: R(x)b R(x)a Is the above sequence valid for a causal consistency model? If not, explain why.

(c) Weak Consistency P1: W(x)a W(x)b S W(x)a P2: R(x)a R(x)b S R(x)b P3: R(x)b R(x)a W(x)b Is the above sequence valid for a weak consistency model? If not, explain why.

(d) Caching and replication are closely related techniques that both create redundant copies of data to improve system scalability, availability, and performance. What are the basic differences between caching and replication (in terms of deciding what data are copied and how consistency of the copies is maintained)?

  1. Election (a) In an asynchronous system, is the Bully algorithm safe? Explain your answer with an example. (b) Give an example execution of the ring-based algorithm to show that processes are not necessarily granted entry to the critical section in happened-before order. Feel free to use a diagram.
  2. Distributed Snapshot (a) Three processes P, Q, and R are connected as a double chain of unidirectional links as shown in the figure below. The processes constantly flood a message m; i.e., whenever a process receives m, it immediately sends m to all of its outgoing links. Each process state consists of a single variable value that shows the number of times the process has received m. The variables are named sP, sQ, and sR, respectively and are all set to zero initially. P creates m, sets sP to 1, and sends m to Q. Immediately after sending m, P initiates Chandy and Lamport’s distributed snapshot algorithm. Explain the operation of the algorithm and describe the final global snapshot it reports. Assume reliable and in-order delivery of messages.