• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | GATE-CS-2006 | Question 85

Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then apply a 5% interest.
  1. T1 start
  2. T1 B old=12000 new=10000
  3. T1 M old=0 new=2000
  4. T1 commit
  5. T2 start
  6. T2 B old=10000 new=10500
  7. T2 commit 
Suppose the database system crashes just before log record 7 is written. When the system is restarted, which one statement is true of the recovery procedure?

(A)

We must redo log record 6 to set B to 10500

(B)

We must undo log record 6 to set B to 10000 and then redo log records 2 and 3.

(C)

We need not redo log records 2 and 3 because transaction T1 has committed.

(D)

We can apply redo and undo operations in arbitrary order because they are idempotent

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments