mid-term-2012

advertisement
ICS223 - Transaction
Management
Processing
and
Distributed
Data
Mid Term, Winter 2012
Department of Computer Science, School of ICS, UC Irvine
Max. Points: (100 points)
Read the following instructions carefully:
- If you find ambiguities in a question or in the schema, write down the interpretation
you are taking, and then answer the question based on your interpretation.
NAME:
Questions
1
2
3
4
5
6
Student ID:
Points
10
30
15
15
15
15
Score
Problem 1 (10 pts)
Assuming that transactions follow the correctness principle, with respect to consistency,
there are several relationships between the concepts "consistent," "serial," "conflictserializable”, “view serializable” and “final state serializable”. You should determine all
cases in which one of these concepts implies another. In the following diagram, if you
think concept “x” implies concept “y,” then draw an arrowed edge from the node of “x”
to the node of “y.” Draw all the implication edges. So that you are clear on what to do,
the edge between serial and CSR is already drawn as an example. The edge denotes that
every serial schedule is also CSR. You need to draw the remaining implication edges
between the nodes.
consistent
Serial
CSR
FSR
VSR
Problem 2 (30 points)
Provide very short (1-2 line if possible) explanations of the following
terms/concepts/protocols. As an example, the first term (viz., no steal buffer management
policy) is already explained. You need to now add similar explanations for other terms.
a) No steal buffer management policy - refers to the policy wherein pages made
dirty by the transaction are not allowed to be flushed to disk until the transaction
commits. This policy simplifies implementation of transaction aborts since disk
resident page is always transaction consistent.
b) REDO logs versus UNDO logs
c) Asynchronous checkpoint
d) Write ahead logging
e) Two phase commit protocol
f) Recoverability property of schedules
g) Strictness property of schedules
h) Predicate serializability
i) Eventual consistency
j) Conservative versus aggressive schedulers
k) Wound-wait strategy for priority based scheduling of transactions
l) Deadlocks versus livelocks
m) Hot Spots
n) Throughput versus response time
o) Data contention versus resource contention
Problem 3: (15 points) Consider a system that uses multi version time stamp ordering
for concurrency control. Let us consider that the data item X has currently the following
versions <X1, X2, X3, X4> with the following read/write timestamps and values
Version
Value
Read Timestamp
Write Timestamp
x1
10
20
12
x2
14
28
25
x3
12
43
40
x4
20
50
45
Explain what would happen if a transaction issues the following operation on data item x
-- would the operation be executed? aborted? will a new version of x be created?
If so, what will its read and write time stamp be? How will the read/write stamp of
existing versions change if a new version is not created?
a) T requests a read(x) operation. T’s timestamp of 13
b) T requests a read(x) operation. T’s timestamp is 22
c) T requests a write(x) operation. T’s timestamp is 41
d) T requests a write(x) operation. T’s timestamp is 44
Problem 4: (15 points) Degree two consistency: Databases often support degree two
consistency wherein transactions acquire S (X) locks for reading (updating) records.
While a transaction following degree-two consistency must hold onto its X locks until
commit or abort, it may release its S locks at any time (in particular even before it has
acquired all its locks).
a) Does degree-two consistency ensure conflict serializability? If yes, provide an intuitive
argument. Else, show through an example that even if transactions follow degree-two
consistency, CSR may be violated.
b) Does degree-two consistency ensure VSR? If yes , provide an intuitive argument. Else,
show through an example that even if transactions follow degree-two consistency, VSR
may be violated.
c) Does degree-two consistency avoids cascading aborts? Again provide an intuitive
justification, or show through an example that even if transactions follow degree-two
consistency, it may result in cascading aborts.
Problem 5: (15 points) Consider the following generalization of the path protocol we
studied in class to tree structures. In the protocol, transactions only acquire X locks.
Each transaction T can lock a data item at most once and it observes the following rules:
1. the first lock by T may be on any data item
2. Subsequently, a data item d can be locked by T only if the parent of d is currently
locked by T.
3. Data item may be unlocked at any time.
4. A data item d locked and unlocked by T cannot subsequently be relocked by T.
Does the above tree protocol ensure that the execution is conflict serializable. Provide an
intuitive justification, or provide an example illustrating that it might result in the
violation of CSR.
Problem 6: (15 points) Now consider a generalization of the tree protocol to a forest
protocol in which the database is organized as a forest of rooted trees. Each transaction T
must observe the following rules:
1. The first lock in each tree may be on any data item
2 The second, and all subsequent locks in a tree may be requested only if the parent of the
requested node is currently locked.
3. Data items may be unlocked at any time.
4. A data item cannot be relocked by T after it has been unlocked by T.
Does the above mentioned forest protocol ensure that schedules are CSR. Either provide
an intuitive argument as to why or show an example illustrating that it may result in
violation of conflict serializability.
Download