Compensation Log Record

On Apr 11, 14:35, Kim Dinh wrote:
> Subject: Compensation Log Record in OI1.2
>
> Could someone please explain for me what the Compensation Log Record
> is used for in the rollback process of OpenIngres 1.2 ?

CLR's are used to record the actions taken during a rollback.
It allows the crash recovery process to repeat history (redo) first,
followed by undo of uncommitted transactions.

6.4 logged physical page before-images and row after-images.  To undo,
all 6.4 had to do was drop the before-images back into place.  If the
undo got interrupted, it didn't matter, because it could just drop all
the before-images back into place again at restart.

OpenIngres uses operation-oriented logging and does not log the entire
page before-image.  To undo, OI has to issue a reversing operation (undoing
inserts with deletes, etc).  The database has to be in the proper state for
this to work, meaning that it has to have all operations done up to the point
where the abort was issued.  That's why OI has to do redo before undo.

Once OI starts undoing, via reversing operations, if a crash occurs
the same concept applies;  it has to bring the DB back to the state at
the point of crash, *including the undo done so far*.  That's where
the CLR's come in.  Redo reissues all the work done by both regular log
records and CLR's, thus replaying history up to the crash point.
Then undo takes over and backs out open transactions, skipping
log records that already have CLR's written (meaning that those log
records were already undone).

By the way, OI does *not* write CLR's during a transaction, unless it
aborts.  OI just reserves space for the CLR's.  It only actually writes
CLR's during a transaction rollback.

There was an article in ACM TODS maybe a couple years ago describing
a logging and recovery system named Aries.  I think it came out of
IBM.  If you want to learn about CLR's and many other interesting perils
and minutiae of logging and recovery algorithms, find and read the article.
OpenIngres's new logging system appears to be very similar to Aries.


Karl R. Schendel, Jr.
K/B Computer Associates   schendel@kbcomputer.com
Ingres and Unix Expertise

Past President, North American Ingres Users Association
past_president@naiua.org
Ingres Q & A
To William's Home Page

© William Yuan 2000

Email William