[Yum-devel] clean up sooner

David Lutterkort dlutter at redhat.com
Sat Feb 18 04:05:05 UTC 2006


On Fri, 2006-02-17 at 01:30 -0500, seth vidal wrote:
> We'd need to break apart each element of the transaction and probably
> just insert them into a sqlite db. Then as we complete that element just
> delete the entry, etc, etc. Then if yum starts up and finds elements in
> the db then it could maybe tell the user that it exited w/o completing
> and they should do 'something' to make it better.
> 
> That was sorta what I was thinking about. I guess it doesn't need to be
> a sqlite db - but that seemed the easiest way to track the transaction
> elements.
> 
> Does anyone else have any other ideas for storing that information?

I don't think there's anything wrong with using a sqlite DB, but it
might be simpler to just use flat files: before actually starting the
transaction, write out what needs to be done into a file in a format
that is convenient to parse back in. As each step of the transaction is
completed, append an entry to the file that says that the corresponding
element actually completed. Of course, you need to make sure that the
file is appropriately flushed after each write.

The point here is that recovering a failed transaction is rare, and can
be made a little more expensive, and just appending to a file makes
writing these logs very cheap.

If you use one file per transaction, you could even keep them around as
an audit log of what yum did on a given system, and people could simply
truncate the logs with an appropriate tmpwatch job. That kinda thing is
a little more hairy if you use a DB.

David





More information about the Yum-devel mailing list