Question: Why does it need to keep undo log for each step of the same memory location instead of just keeping the original value?
This comment was marked helpful 0 times.
@TeBoring. Your suggestion is a nice potential optimization.
@TeBoring: I think it depends on whether you are undoing the whole transaction (in this case your suggestion should work) or undoing the transactions partially when you see a conflict.
Eager versioning is preferred when we expect fewer conflicts since it has faster commits than aborts.
This is very much like a lower level (memory level) implementation of the distributed system logging mechanisms. In distributed systems, logging involves rather complicated issues like role back, when commits fail. I imagine it would be very expensive to implement this kind of operation in memory level.
Does eager versioning allow other processors to see the values set during this transaction? For instance, if CPU 1 initiates a transaction and writes to A, then CPU 2 reads A, will it receive the old or new value of A?