db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: Derby architecture/design documents
Date Tue, 01 Feb 2005 23:29:35 GMT
In terms that derby uses all redo log log records are physical, and by
this I mean they apply to one page and the work on them can be redone by
looking at the log record and applying the work to the version of the
page just before the one noted in the log record.  No datatype
comparisons are necessary.

Currently the only logical action is in btrees for undo of insert or
delete operations.  As you note undo of structural changes are
physical.  So at the high level recovery goes as follows:

Find the oldest log record that needs to be looked at.
Go forward from that point and redo each record in log file
    (if version of page is later than log record then no work to do)
Undo all nested top transactions which must only require physical undo,
    which are basically structural changes
    like btree split and/or page allocations.  Now all tree structures
    are intact so that logical undo is possible.

Finally undo any other outstanding transactions, now that tree's are
structurally sound, undo can be physical and/or logical.

XA adds some extra work and should be documented separately.

Dibyendu Majumdar wrote:

> Mike,
> A quick question about logging and recovery:
> Are redo log records always physical - i.e. page orientated?
> I am guessing that undo records are sometimes logical and sometimes
> physical. My guess is that it is physical for structural changes, but
> logical for row inserts/deletes, etc. Is that correct?
> I am going to try and describe logging and recovery next.
> Thanks for your comments on the previous document - I will update and
> resubmit.
> Regards

View raw message