design documents? [logs]

Ross Boylan RossBoylan at stanfordalumni.org
Sat Mar 29 12:32:40 EDT 2008


On Sat, 2008-03-29 at 12:11 -0400, Derek Atkins wrote:
> I would look in src/import-export/log-replay/
> 
> If there's no old transaction then the input is either NULL or
> empty and the log outputs a 'create'.
> 
> -derek
Are you referring to the input to log-replay, the input to
xaccTransWriteLog, or to what goes out to the log on disk?  Looking at
my own logs, it appears that for new transactions the same entry appears
as a B and then a C on the disk.  So the comment should be
'B' for 'begin edit' (followed by the transaction as it
looks before any changes, i.e. the 'old value'
OR THE NEW VALUE IF THERE IS NO OLD VALUE).

The transactions in the one log that deleted stuff seem really messed
up.  The "regular" transactions do not have a split for the primary
account I was entering them in; instead they have a big Imbalance-USD
entry.  Then come the deletion of the stock sales, and finally the
deletion of a regular transaction from a year ago.

> 
> Quoting Ross Boylan <RossBoylan at stanfordalumni.org>:
> 
> >
> > On Sat, 2008-03-29 at 08:54 -0700, Ross Boylan wrote:
> >> On Sat, 2008-03-29 at 11:40 -0400, Derek Atkins wrote:
> >> > I'm afraid that really there are no good design docs.  Certainly
> >> > nothing coherent.  Many times there are email discussions when a
> >> > feature is being created, but nothing really gets put down for
> >> > posterity in the source tree.  Unfortunately I have to say the
> >> > the design doc is the source code.
> >> >
> >> > -derek
> >> Could anyone point me to where I can start to understand the log file
> >> format?  As I said, my main interest is in effecting a repair, possibly
> >> by using excerpts from a previous log file.
> >>
> >> It looks as if the documentation has moved mostly to doxygen, and I've
> >> discovered http://svn.gnucash.org/docs/HEAD/index.html.  However, the
> >> discussion of backup says "The actual file writing is done by
> >> xaccWriteAccountGroupFile() in in src/engine/FileIOP.hv" and that file
> >> doesn't seem to exist (nor does a search on doxygen turn up the
> >> function).
> > I found this:
> >
> > void
> > xaccTransWriteLog
> > (
> > Transaction *
> > trans,
> >
> >
> > char
> > flag
> >
> >
> > )
> >
> >
> >
> > Parameters:
> >
> >        trans
> >        The transaction to
> >        write out to the log
> >
> >        flag
> >        The engine currently
> >        uses the log
> >        mechanism with flag
> >        char set as follows:
> >        'B' for 'begin
> >        edit' (followed by
> >        the transaction as it
> >        looks before any
> >        changes, i.e. the
> >        'old value') 'D' for
> >        delete (i.e. delete
> >        the previous B;
> >        echoes the data in
> >        the 'old B') 'C' for
> >        commit (i.e. accept a
> >        previous B; data that
> >        follows is the 'new
> >        value') 'R' for
> >        rollback (i.e. revert
> >        to previous B; data
> >        that follows should
> >        be identical to old
> >        B)
> >
> > So what if I have a new transaction, i.e., there is no old value?
> >
> 
> 
> 


More information about the gnucash-devel mailing list