Previous | Next --- Slide 27 of 64
Back to Lecture Thumbnails
regi

What happens in the case of an aborted transaction, other than undoing the updates? Does the system attempt to retry the transaction until it succeeds, or is there a failure case the programmer must specify (similar to the try/catch exceptions in the last slide)?

HLAHat

I believe the system attempts to retry. If implemented carelessly, this could lead to starvation (where one transaction is constantly being reset by other transactions) or even livelocks (two transactions keep resetting each other). Therefore, the scheduler/manager for the transactions must be smart enough to make sure every transaction has a fair shot of being committed.

russt17

I don't think the example here is suggesting the operation is redone. Maybe some other code would reevaluate after the failure and could potentially decide to redo. The important part is that the operation is at least all-or-nothing and that if it fails part way through execution, the stuff that got done will be undone.

dsaksena

I agree with @HLAHat, the thread which failed to complete its transaction simply retries. Its state is restored (even the registers) so it simply runs the code again.

afzhang

@regi It says on slide 31 that failure recovery involves aborting the transaction and restarting it.

yuel1

So I would be careful in using the term "undoing", technically none of the operations have been committed, and thus no changes have been made visible to the rest of the system.