Assignment Q2.1

79 views
Skip to first unread message

Davy Zhou

unread,
May 5, 2021, 9:25:58 AM5/5/21
to COMP9311-21T1

Capture.PNG
Can I get a thorough explanation why T1: Undo and T2: Redo?

Thanks

Davy Zhou

unread,
May 5, 2021, 11:02:29 PM5/5/21
to COMP9311-21T1
  • The recovery system reads the logs backwards from the end to the last checkpoint.

  • It maintains two lists, an undo-list and a redo-list.

  • If the recovery system sees a log with <Tn, Start> and <Tn, Commit> or just <Tn, Commit>, it puts the transaction in the redo-list.

  • If the recovery system sees a log with <Tn, Start> but no commit or abort log found, it puts the transaction in undo-list.

https://www.tutorialspoint.com/dbms/dbms_data_recovery.htm


Shouldn't T1 also be redo since it has committed T1 with W(B) occurring between checkpoint and crash?

K S

unread,
May 5, 2021, 11:43:03 PM5/5/21
to COMP9311-21T1
Hi

I think you better reference the lecture notes provided by Professor Lin only, rather than looking for any other external resources. Otherwise, your answer will be seen as incorrect.

This may help if you review Slide 25-26 pages for Transaction Management in Week 7.

Victoria Ho

unread,
May 6, 2021, 6:50:38 AM5/6/21
to COMP9311-21T1
transactions.png
Consider the transaction schedule above for better visualisation.

We redo on committed and completed transactions and an undo on partially-performed ones. To preserve Atomicity (in ACID), you either do the whole transaction, or not at all. It's all-or-nothing. You cannot only do part of the transaction.
Note that by the crash after t9, T1 has not yet committed, whereas we can assume that T2 has (without any other information about its completion).
checkpoint.png

Davy Zhou

unread,
May 6, 2021, 9:13:27 AM5/6/21
to Victoria Ho, COMP9311-21T1
So wouldn’t T1 be a redo and undo?


From: comp93...@googlegroups.com <comp93...@googlegroups.com> on behalf of Victoria Ho <ianh...@gmail.com>
Sent: Thursday, May 6, 2021 8:50:38 PM
To: COMP9311-21T1 <comp93...@googlegroups.com>
Subject: Re: Assignment Q2.1
 
--
You received this message because you are subscribed to a topic in the Google Groups "COMP9311-21T1" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/comp9311-21t1/A6Yc9TVN5JY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to comp9311-21t...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/comp9311-21t1/f0a63186-2199-4922-b712-1c8c50beedb4n%40googlegroups.com.

Victoria Ho

unread,
May 6, 2021, 9:14:38 AM5/6/21
to COMP9311-21T1
No, T1 would be an undo, because T1 has not yet completed by the time of the crash.
T2 would be a redo, because it would've committed and completed by the time of the crash.

2021年5月6日木曜日 23:13:27 UTC+10 dvdav...@gmail.com:

Davy Zhou

unread,
May 6, 2021, 9:17:22 AM5/6/21
to Victoria Ho, COMP9311-21T1
In T1, it has complete item B so is also redo?


From: comp93...@googlegroups.com <comp93...@googlegroups.com> on behalf of Victoria Ho <victoria...@gmail.com>
Sent: Thursday, May 6, 2021 11:14:38 PM
You received this message because you are subscribed to the Google Groups "COMP9311-21T1" group.
To unsubscribe from this group and stop receiving emails from it, send an email to comp9311-21t...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/comp9311-21t1/b8a55b4f-4058-459a-9141-b702129c856fn%40googlegroups.com.

Victoria Ho

unread,
May 6, 2021, 9:20:13 AM5/6/21
to COMP9311-21T1
Remember Atomicity. The only way to preserve Atomicity is to take the transaction as a whole, or not at all. You cannot break it up into operations.

2021年5月6日木曜日 23:17:22 UTC+10 dvdav...@gmail.com:

Davy Zhou

unread,
May 6, 2021, 9:21:29 AM5/6/21
to Victoria Ho, COMP9311-21T1
Got it. Thanks!


Sent: Thursday, May 6, 2021 11:20:12 PM
Reply all
Reply to author
Forward
0 new messages