+ All Categories
Home > Documents > 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open...

05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open...

Date post: 18-Jan-2018
Category:
Upload: estella-webb
View: 215 times
Download: 0 times
Share this document with a friend
Description:
05/11/2011ecs251 spring 2011, midterm3 (Soft Update) In each of the following diagrams, we have TWO directory blocks and TWO I-Node blocks. The first row shows the initial values of memory and disk BEFORE the synchronization. And, the second row shows a step-by-step sequence of block updates following the rules of “Soft Update” to synchronize the memory/disk. HOWEVER, the first sequence (this and next slide, p.3 & p.4) is worse than the second sequence (the next two slides, p.5 & p.6) for one PERFORMANCE-related reason. Please state the reason as your answer. Q-02 DE7 (empty) DE3 (empty) DE5 (empty) iN(DE5) (empty) iN(DE7) (empty) iN(DE3) (empty) DE7 DE2 (empty) DE8 (empty) iN(DE2) (empty) iN(DE7) (empty) iN(DE8) DE7 (empty) DE3 (empty) DE5 (empty) iN(DE5) (empty) iN(DE7) (empty) iN(DE3) (empty) memorydisk DE7 (empty) DE3 (empty) DE5 (empty) iN(DE5) (empty) iN(DE7) (empty) iN(DE3) (empty) iN(DE3) iN(DE8) (empty) iN(DE2) (empty) iN(DE7) DE7 DE2 (empty) DE8 (empty) DE8 (empty) iN(DE3) iN(DE8) (empty) iN(DE2) (empty) iN(DE7) DE7 (empty) DE3 (empty) 1st
16
05/11/2011 ecs251 spring 2011, midterm 1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at most 4 to answer, 10% each), 16 pages. Please write precise and clean answers for AT MOST FOUR QUESTIONS. Only THREE questions (with HIGHER SCORES) will be counted toward your grade. Please READ the questions VERY CAREFULLY before putting down the final answer. And, also please mark your answer clearly. You can use the back of the pages. Every page of this exam book needs to be returned back. If we suspect any cheating behavior, we will pass the case to the academic committee immediately. Score: ___/30
Transcript
Page 1: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

05/11/2011 ecs251 spring 2011, midterm 1

ecs251 Spring 2011 midterm

Name:Student ID:Email:Open book/laptop/Internet and totally 10 questions (choose at most 4 to answer, 10% each), 16 pages.

Please write precise and clean answers for AT MOST FOUR QUESTIONS. Only THREE questions (with HIGHER SCORES) will be counted toward your grade. Please READ the questions VERY CAREFULLY before putting down the final answer. And, also please mark your answer clearly. You can use the back of the pages. Every page of this exam book needs to be returned back.

If we suspect any cheating behavior, we will pass the case to the academic committee immediately.

Score: ___/30

Page 2: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

05/11/2011 ecs251 spring 2011, midterm 2

(Soft Updates, Snapshot and Background FSCK) If we remove Soft Update mechanism from our File system implementation and the file system crashes, then we CANNOT use this file system IMMEDIATELY right after rebooting and taking a SNAPSHOT for background FSCK. Please state/explain the reason. Specifically, please explain (you can give an example) that why, without Soft Update, some meta data might NOT be “COPY-ON-WRITE” and, thus, causing a UNSAFE condition (such as 1-1 for block consistency or D>L for file consistency) for using the FS immediately.

Q-01

Page 3: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

05/11/2011 ecs251 spring 2011, midterm 3

(Soft Update) In each of the following diagrams, we have TWO directory blocks and TWO I-Node blocks. The first row shows the initial values of memory and disk BEFORE the synchronization. And, the second row shows a step-by-step sequence of block updates following the rules of “Soft Update” to synchronize the memory/disk. HOWEVER, the first sequence (this and next slide, p.3 & p.4) is worse than the second sequence (the next two slides, p.5 & p.6) for one PERFORMANCE-related reason. Please state the reason as your answer.

Q-02

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

DE2

(empty)

(empty)

(empty)

(empty)

(empty)

DE8

(empty)

iN(DE2)

(empty)

iN(DE7)

(empty)

(empty)

(empty)

iN(DE8)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

memory disk

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

(empty)

(empty)

iN(DE3)

iN(DE8)

(empty)

iN(DE2)

(empty)

iN(DE7)

DE7

DE2

(empty)

(empty)

(empty)

(empty)

(empty)

DE8

(empty)

(empty)

(empty)

DE8

(empty)

(empty)

iN(DE3)

iN(DE8)

(empty)

iN(DE2)

(empty)

iN(DE7)

DE7

(empty)

DE3

(empty)

1st

Page 4: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

05/11/2011 ecs251 spring 2011, midterm 4

memory disk

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

(empty)

DE8

(empty)

(empty)

iN(DE3)

iN(DE8)

DE7

(empty)

DE3

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

iN(DE8)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

Page 5: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

05/11/2011 ecs251 spring 2011, midterm 5

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

DE2

(empty)

(empty)

(empty)

(empty)

(empty)

DE8

(empty)

iN(DE2)

(empty)

iN(DE7)

(empty)

(empty)

(empty)

iN(DE8)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

memory disk

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

The 2nd Sequence – this one is better but why?

Page 6: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

05/11/2011 ecs251 spring 2011, midterm 6

memory disk

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE7

(empty)

DE3

(empty)

DE5

(empty)

(empty)

(empty)

iN(DE5)

(empty)

(empty)

iN(DE7)

(empty)

(empty)

iN(DE3)

(empty)

DE5

(empty)

(empty)

(empty)

(empty)

(empty)

iN(DE3)

(empty)

Page 7: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

05/11/2011 ecs251 spring 2011, midterm 7

Q-02 (hint: this question can be answered in just a couple sentences. Please focus on the FIRST block update and explain what’s wrong with that.)

Page 8: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

If we use the timestamp ordering approach for concurrency control and follow this execution history, then, which transaction(s) will be aborted and WHY?Q-03

TSstart1=1

beginread X

read Y

read Z

read W

end

TSstart2=2

begin

read W

read X

read Y

write Xwrite Yend

TSstart3=3

begin

read X

read Y

read Z

write Y

write Z

end

TSstart4=4

begin

read Yread Z

read W

write Zwrite W

end

05/11/2011 8ecs251 spring 2011, midterm

Page 9: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

With the “backward and serial validation” of OCC (Optimistic Concurrency Control), for the following execution history, which transaction(s) will be aborted and WHY?Q-04

T1:read Z

read W

read Xread Yvalidation

T2:

read W

read X

read Y

write Xwrite Yvalidation

T3:

read X

read Y

write Ywrite Xvalidation

T4:

read Yread Z

read W

write Zwrite Wvalidation

05/11/2011 9ecs251 spring 2011, midterm

Page 10: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

Q-05Under DOCC (Distributed/Decentralized OCC), when and how would a global transaction (i.e., a transaction involving multiple local sub-transactions/servers) obtain its mvID (maximum validation ID)?

Coordinator

Server Server Server Server Server…..

CoordinatorCoordinator

05/11/2011 10ecs251 spring 2011, midterm

Page 11: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

(Two Phase Commit) Under exactly which condition, under the 2PC protocol, we have to wait for a crash server to recover before we can continue the commitment protocol?

Q-06

05/11/2011 11ecs251 spring 2011, midterm

Page 12: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

(Transaction Support for GFS) Under this question, we will consider to build a transaction system on top of GFS (instead of on top of a Database). When a transaction needs to access an object (either read or write access), it needs to contact the Master (the Master under GFS but with some extensions to support transaction) first. For supporting the ACID properties, we can potentially use either 2PL (Two-Phase Locking) or OCC (Optimistic Concurrency Control) to guarantee serilizability. Please decide which option (2PL or OCC) is better for GFS transactions and WHY?

Q-07

05/11/2011 12ecs251 spring 2011, midterm

Page 13: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

(DHT/Chord) Here is a short description of Chord from Wikipedia:

The Chord protocol is one solution for connecting the peers of a P2P network. Chord consistently maps a key onto a node. Both keys and nodes are assigned an m-bit identifier. For nodes, this identifier is a hash of the node's IP address. For keys, this identifier is a hash of a keyword, such as a file name. It is not uncommon to use the words "nodes" and "keys" to refer to these identifiers, rather than actual nodes or keys. There are many other algorithms in use by P2P, but this is a simple and common approach.A logical ring with positions numbered 0 to 2m − 1 is formed among nodes. Key k is assigned to node successor(k), which is the node whose identifier is equal to or follows the identifier of k. If there are N nodes and K keys, then each node is responsible for roughly K / N keys.

When a new node joins or leaves the network, responsibility for O(K / N) keys changes hands.If each node knows only the location of its successor, a linear search over the network could locate a particular key. This is a naive method for searching the network, since any given message could potentially have to be relayed through most of the network. Chord implements a faster search method.Chord requires each node to keep a "finger table" containing up to m entries. The ith entry of node n will contain the address of successor((n + 2i − 1) mod 2m).

With such a finger table, the number of nodes that must be contacted to find a successor in an N-node network is O(logN).

QUESTION: Should the last part be O(logN) or O(m) (i.e., the size of the network versus the size of the ring)? Please justify your answer!

Q-08

05/11/2011 13ecs251 spring 2011, midterm

Page 14: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

Q-08

05/11/2011 14ecs251 spring 2011, midterm

Page 15: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

Q-09 (Kleinberg’s Search Algorithm) Under the Kleinberg’s search algorithm, you must know the coordinate of the target and you must have a way to measure/estimate the metric distances between your friends and the target. Please describe an example application and argue that why, under this application domain, it is practically or theoretically impossible to support this model.

05/11/2011 15ecs251 spring 2011, midterm

Page 16: 05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Email: Open book/laptop/Internet and totally 10 questions (choose at.

Q-10 (Map and Reduce) Please describe a parallel application (i.e., an application can naturally leverage a parallel system to speed up its execution performance) which doesn’t fit well with the Map and Reduce paradigm. Please explain why?

05/11/2011 16ecs251 spring 2011, midterm


Recommended