21.6. Idempotent undo and redo operations

A transaction can make a number of different types of change to a database, for example:

  • delete an existing object;

  • create a new object;

  • invoke an operation which changes an object's state.

A crash might occur at any time, including in the middle of undoing or redoing invocations during failure recovery. No assumptions should therefore be made about whether the object has its old or new value and the UNDO and REDO operations must be made idempotent (repeatable) by some means.

We have made the simplifying assumption in this chapter that an object's state before and after an invocation is recorded in the log record associated with the invocation. If this is the case, an idempotent UNDO operation can simply ...

Get Operating Systems: Concurrent and Distributed Software Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.