0% found this document useful (0 votes)
80 views4 pages

CS 4320/5320 Homework 5: 1 Consistency Models (15 Points)

This document outlines the instructions for Homework 5, which is due on December 3rd. It consists of 4 questions worth a total of 50 points. Students must complete the homework in groups of 2-3 people and submit one file with all answers. The questions cover topics like consistency models, ARIES recovery, locking protocols for B+ trees, and two-phase commit. The document reminds students to cite any external sources and comply with the academic integrity policy.

Uploaded by

Edward Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views4 pages

CS 4320/5320 Homework 5: 1 Consistency Models (15 Points)

This document outlines the instructions for Homework 5, which is due on December 3rd. It consists of 4 questions worth a total of 50 points. Students must complete the homework in groups of 2-3 people and submit one file with all answers. The questions cover topics like consistency models, ARIES recovery, locking protocols for B+ trees, and two-phase commit. The document reminds students to cite any external sources and comply with the academic integrity policy.

Uploaded by

Edward Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS 4320/5320 Homework 5

Fall 2014
Due Wed Dec 3rd, 2014

This assignment is due Wednesday, 12/03/2014 at 11:59pm. It is out of 50


points and counts for 10% of your overall grade.
You must work on this homework in groups of 2 or 3 students. You
should make one CMS submission for your entire group, and everyone in the
group will receive the same grade.
Academic integrity reminder: This is a written homework and some
of the questions are similar to questions from your textbook. If you use any
external materials such as publicly available textbook exercise solutions, you
must cite them as your source. Sadly, every year a student or two end up
in a stressful academic integrity hearing, not because they referred to textbook
solutions, but because they failed to acknowledge in their submission that
they did this. Dont be one of those students!

1 Consistency Models (15 Points)


In class, you have seen conflict graphs for schedules. This question is about a
different but related kind of graph called a dependency graph. In a dependency
graph, the nodes are operations such as R1 (A) or W2 (B), and there is an edge
from operation X to operation Y if operation X must always appear before
operation Y in any permissible schedule.
For example, suppose we have have a single transaction T which performs
the operations R(A)W (A)W (B), and we know that T will be executed in the
system by itself. The dependency graph corresponding to this situation has
three nodes, an edge from R(A) to W (A), and another edge from W (A) to
W (B). This graph captures the constraint that when the system executes T ,
it needs to perform its operations in order (it is not allowed to reorder code
inside a single transaction). R(A) must also occur before W (B), but that edge
is implied by transitivity so we can leave it out of the graph.
Now consider the following three transactions:

T 1 : R1 (A), R1 (B), W1 (C), C(1)


T 2 : R2 (A), W2 (A), R2 (C), W2 (C), C(2)
T 3 : R3 (A), W3 (B), R3 (B), C(3)

1
(Note: We use Rn (A) to denote transaction n reads element A, C(n) denotes
commit transaction n)
Draw the dependency graph for:

a serial execution of the above transactions in the order 1, 2, 3


a conflict-serializable execution of the above transactions with equivalent
serial order 1, 2, 3. Note that there are many different schedules that will
meet the above criterion, but all of them must respect certain dependen-
cies/ordering constraints on the operations; the question is asking you to
capture in the graph the dependencies that must hold in all schedules that
are conflict-serializable with equivalent serial order 1, 2, 3.
an execution of the three transactions at isolation level READ UNCOMMITTED.
Again, there will be many possible valid schedules (that meet the criterion
we give), and your graph should only capture the dependencies that hold
in all valid schedules.

2 ARIES Recovery (15 Points)


Consider a database that performs the following operations
W1 (A), W1 (B), W2 (C), W3 (D), C(3), W2 (D), W1 (D)
then crashes. Assume this database uses ARIES for recovery and has done no
other operations. Assume each of the objects is on a different page, i.e. A is on
page PA , B is on page PB , and so on.
What logging must be done for each operation? Also, what are the steps
taken, in detail, to recover the database after the crash?

3 Locking (10 Points)


Consider the improved B+ tree locking protocol described in section 17.5.2
of your course textbook, where inserts and deletes use shared locks until they
reach the leaf and request lock upgrades for internal nodes if necessary. Also
consider the following B+ tree.

2
Describe the locking behavior needed to perform the following operations
(i.e. give the full sequence of lock and unlock requests that must be performed
for each operation).
Search for 19
Insert 43

Insert 13
Delete 4
Delete 42

4 Two-Phase Commit (10 Points)


Briefly answer the following questions (one or two sentences each).

Describe why we need a commit protocol in distributed databases.


Why are ack messages needed?
What is the intuition behind 3PC as an improvement over 2PC?

What are the differences between 2PC and 2PC with Presumed Abort?

Submission Instructions
Submit one file:

A .pdf file containing all of your written answers. As usual, these must be
typed, scans of handwritten answers are not accepted.
Ensure the file contain the netID of everyone in your group and clearly state
which answer corresponds to which question.

3
5 Late Submissions:
See the standard course late policy as posted in CMS.

6 Academic Integrity:
See the standard course academic integrity policy as posted in CMS.

You might also like