To solve this problem we need to follow certain steps :-
Read the log file backwards up to the checkpoint (not before it) :-
1) If you find (commit, Ti) , add Ti to Redo-list.
2) If you find (start, Tj), add Tj to Undo-list. (Here note that Tj is a transaction which has only started and not committed i.e. no (commit, Tj) is found before (start, Tj) while retracing backwards).
3) Suppose there was a transaction which started before checkpoint but has not committed either before or after the checkpoint( in this case it is T1). Now how will we get to know about it as we can't go before checkpoint? Here is a thing we need to know that checkpoint maintains a list of all active transactions. Add such transaction to the Undo-list.
So now using these we can go ahead :-
(start, T4);
(write, T4, y, 2, 3);
(start, T1);
(commit, T4);
(write, T1, z, 5, 7);
(checkpoint);
(start, T2);
(write, T2, x, 1, 9);
(commit, T2);
(start, T3);
(write, T3, z, 7, 2);
We move backwards, find (start, T3) and no (commit, T3) before (in our path of going backwards). So put it in Undo-list. <Step 2>
Then find (commit, T2) so put it in Redo-list. <Step 1>
Since T4 has already committed before checkpoint so this checkpoint does not have T4 in it's list of active transaction. Only T1 is there as it has started but has not committed anywhere. So put T1 in Undo-list. <Step 3>
Final answer: Undo-list- {T3,T1} ; Redo-list- {T2}. Option A.
Reference: https://www.youtube.com/watch?v=H9zYo0KY1Kw&t=889s