Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the following log sequence of two tr... Start Learning for Free
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 undo log record 6 to set B to 10000 and then redo log records 2 and 3. 
  • b)
    We must redo log record 6 to set B to 10500.
  • c)
    We need not redo log records 2 and 3 because transaction T1 has committe
  • d)
    d. We can apply redo and undo operations in arbitrary order because they are idempotent.
Correct answer is option 'A'. Can you explain this answer?
Most Upvoted Answer
Consider the following log sequence of two transactions on a bank acco...
We must undo log record 6 to set B to 10000 and then redo log records 2 and 3 because system fails before commit operation. So, we need to undo active transactions (T2) and redo committed transactions (T1).
Note: Here we are not using checkpoints.
Checkpoint : Checkpoint is a mechanism where all the previous logs are removed from the system and stored permanently in a storage disk. Checkpoint declares a point before which the DBMS was in consistent state, and all the transactions were committed.
Recovery: When a system with concurrent transactions crashes and recovers, it behaves in the following manner:
 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.All the transactions in the undo-list are then undone and their logs are removed. All the transactions in the redo-list and their previous logs are removed and then redone before saving their logs.
Free Test
Community Answer
Consider the following log sequence of two transactions on a bank acco...
Recovery Procedure Explanation:

To understand the recovery procedure, let's analyze the log sequence and its implications step by step:

1. T1 start: The transaction T1 starts.

2. T1 B old = 12000 new = 10000: The old value of B (balance) is 12000, and it is updated to 10000.

3. T1 M old = 0 new = 2000: The old value of M (mortgage payment) is 0, and it is updated to 2000.

4. T1 commit: Transaction T1 commits.

5. T2 start: The transaction T2 starts.

6. T2 B old = 10000 new = 10500: The old value of B (balance) is 10000, and it is updated to 10500.

7. T2 commit: Transaction T2 commits.

Now, let's consider the scenario where the database system crashes just before log record 7 is written.

Analysis:

- The last committed transaction is T2, as T1 has already committed before T2.

- The value of B (balance) is updated from 10000 to 10500 in log record 6.

- The value of B (balance) is updated from 12000 to 10000 in log record 2.

- The value of M (mortgage payment) is updated from 0 to 2000 in log record 3.

Recovery Procedure:

Based on the above analysis, the recovery procedure should be as follows:

1. Undo log record 6: We need to undo the changes made by T2. So, the value of B should be set back to 10000.

2. Redo log records 2 and 3: After undoing log record 6, we need to redo the changes made by T1. So, the value of B should be updated from 12000 to 10000, and the value of M should be updated from 0 to 2000.

Therefore, the correct recovery procedure is to undo log record 6 and then redo log records 2 and 3.

Conclusion:

The correct answer is option 'A'. We must undo log record 6 to set B to 10000 and then redo log records 2 and 3. This recovery procedure ensures that the correct values are restored after the crash and the changes made by both transactions are correctly applied.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer?
Question Description
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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about 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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for 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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer?.
Solutions for 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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of 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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of 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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer?, a detailed solution for 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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of 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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice 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. T1 start T1 B old = 12000 new = 10000 T1 M old = 0 new = 2000 T1 commit T2 start T2 B old = 10000 new = 10500 T2 commitSuppose 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 undo log record 6 to set B to 10000 and then redo log records 2 and 3.b)We must redo log record 6 to set B to 10500.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.Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev