[Yum-devel] clean up sooner
Dennis Gregorovic
dgregor at redhat.com
Mon Feb 20 02:34:30 UTC 2006
On Fri, 2006-02-17 at 20:05 -0800, David Lutterkort wrote:
> 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
I spent time this weekend reading up on the Python RPM bindings and
after some experimenting I think I know what it will take to add the
transaction logging functionality. Unfortunately, it looks like we are
currently blocked on a bug in the Python bindings that was fixed in RPM
4.4.3 (Rawhide is on 4.4.2). I've filed a bug requesting inclusion of
the patch: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=182063
David, your reasons for a flat-file approach sound good. I'll try to
put together a patch this week.
Cheers
-- Dennis
More information about the Yum-devel
mailing list