SRS
October 6, 2023
SRS
October 6, 2023
SRS
October 6, 2023
SRS
October 6, 2023

Database-Management-System

Question 335

Consider the following sequence of two transactions on a bank account(A) with initial balance 20,000 that transfers 5,000 to another account (B) and then apply 10% interest.

    (i)   T1 start
    (ii)  T1 A old=20000 new 15,000
    (iii) T1 B old=12000 new=17000
    (iv)  T1 commit
    (v)   T2 start
    (vi)  T2 A old=15000 new=16500
    (vii) T2 commit

Suppose the database system crashes out just before log record (vii) is written. When the system is restricted, which one statement is true of the recovery process ?

A
We can apply redo and undo operation in arbitrary order because they are idempotent.
B
We must redo log record (vi) to set A to 16,500.
C
We must undo log record (vi) to set A to 16,500 and then redo log record (ii) and (iii).
D
We need not redo records (ii) and (iii) because transaction T1 has committed.
Question 335 Explanation: 
In log based recovery we must perform ‘Redo’ operation for those transactions that contains both start and commit log record.

We perform ‘undo’ operation for those transaction that contains only start but not commit log record.
Therefore we perform ‘Redo’ of T1 and ‘Undo’ of T2.
Note: Actually they given option-3 is “ We must redo log record (vi) to set A to 16,500 and then redo log record (ii) and (iii)”. But we found it is wrong. Given correct option instead of wrong one.
Correct Answer: C
Question 335 Explanation: 
In log based recovery we must perform ‘Redo’ operation for those transactions that contains both start and commit log record.

We perform ‘undo’ operation for those transaction that contains only start but not commit log record.
Therefore we perform ‘Redo’ of T1 and ‘Undo’ of T2.
Note: Actually they given option-3 is “ We must redo log record (vi) to set A to 16,500 and then redo log record (ii) and (iii)”. But we found it is wrong. Given correct option instead of wrong one.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!