Question

Question 1: Assume that initially A-5 and B:10. The following are 3 transactions on A and B (→ denotes assignmen): TI : A+B → A: A+B → B T2: A+B → B: A+B → A * For each transaction, a) add necessary read- and write-actions to the computation; b) show the undo/redo-log records for each of the transactions. Question 2: The following is a sequence of undo/redo-log records generated by two transactions, T and U: COMMIT U>:<T,E,50.51: <COMMIT T> Suppose there is a crash and, upon recovery, the last log record appeared on disk is one of the following four possibilities: (a) <START U (b) COMMIT U> (d) <COMMIT T> For each possibility, to recover from the crash, describe what values written by T and U must appear on disk, and which values might appear on disk. Describe the actions of the recovery manager, including changes to both disk and the log.

media%2Fdbb%2Fdbb50131-a8d0-499b-85e0-3d

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi,
Its against HomeworkLib policy to ask multiple questions in one, please post others as separate questions
Question 1:
Given transactions are
T1:A+B->A; A+B->B
T2:A+B->B;A+B->A
T3:B+1->A;A+1->B
a) read and write transactions.
To perform any computation on any variable, we need to read it first
so in T1, the read writes would be as follows
read A
read B
write A+B to B
read A
read B
write A+B to A
for T2:
read A
read B
write A+B to A
read A
read B
write A+B to B
for T3:
read B
write B+1 to A
read A
write A+1 to B

b) undo/redo log are written when a write happens so that the system can be recovered when a crash happens
therefore
in T1: we have the following reads and writes as shown above
read A
read B
write A+B to B - this is added as <T1,B, 10,15> in the format <transactionId, element, before value, after value>
read A
read B
write A+B to A - this is added as <T1,A, 5,20> in the format <transactionId, element, before value, after value>

for T2:
read A
read B
write A+B to A- this is added as <T1,A, 5,15> in the format <transactionId, element, before value, after value>
read A
read B
write A+B to B- this is added as <T1,B, 10,25> in the format <transactionId, element, before value, after value>

for T3:
read B
write B+1 to A - this is added as <T1,A, 5,11> in the format <transactionId, element, before value, after value>
read A
write A+1 to B - this is added as <T1,B, 10,12> in the format <transactionId, element, before value, after value>
Thumbs up if this was helpful, otherwise let me know in comments

Add a comment
Know the answer?
Add Answer to:
Question 1: Assume that initially A-5 and B:10. The following are 3 transactions on A and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Student #2 C- 72% 144 34 0 40 70 Student #3 74% C 148 40 10 43 55 Student # 4 50 36 A 93% 186 10 90 Student #5 B+ 87% 1...

    Student #2 C- 72% 144 34 0 40 70 Student #3 74% C 148 40 10 43 55 Student # 4 50 36 A 93% 186 10 90 Student #5 B+ 87% 174 48 10 46 70 Student #6 56% 112 44 5 28 35 Student #7 65 84% 168 50 10 43 Student #8 48 B- 80% 159 46 10 55 Student #9 C+ 79% 158 50 10 73 25 Student #10 86% 172 33 5 44 90 Student...

  • Case: Enron: Questionable Accounting Leads to CollapseIntroductionOnce upon a time, there was a gleaming...

    Case: Enron: Questionable Accounting Leads to CollapseIntroductionOnce upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant “E,” slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm laid off 4,000...

  • CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a...

    CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant "E" slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT