Bug 91325 - Need rpm to rollback failed transactions automatically.
Summary: Need rpm to rollback failed transactions automatically.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-05-21 14:32 UTC by James Olin Oden
Modified: 2007-04-18 16:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-04-19 18:56:17 UTC
Embargoed:


Attachments (Terms of Use)
Patch to cause rpm to conditioinally rollback a transaction on a failure. (18.42 KB, patch)
2003-05-21 15:30 UTC, James Olin Oden
no flags Details | Diff
The one that works (-; (24.58 KB, patch)
2003-06-08 00:32 UTC, James Olin Oden
no flags Details | Diff
Fixes problem with instance count passed to scriptlets (39.30 KB, patch)
2003-09-08 17:34 UTC, James Olin Oden
no flags Details | Diff
Description of instance count correction algorithm used with autorollback transactions. (2.19 KB, text/plain)
2003-09-08 17:49 UTC, James Olin Oden
no flags Details
I broke --test with the patch...its fixed now. (39.46 KB, patch)
2003-10-14 01:55 UTC, James Olin Oden
no flags Details | Diff

Description James Olin Oden 2003-05-21 14:32:08 UTC
Description of problem:
In its present form if an error occurs in one of the scriptlets of an rpm,
RPM will continue trying to install the other transaction elements of the 
transaction.  It is understood why this is the default behaviour, but for
some environments (think CGL) its not desirable.

It would be good if rpm could be set to rollback a transaction if it failed.


Version-Release number of selected component (if applicable):
4.2-0.69

How reproducible:
Very

Steps to Reproduce:
1.  Create an a few rpms, one of which fails in %pre or %post.
    Be careful to make sure that the other rpms depend on the broken 
    one.
2.  Upgrade this set of RPMS.
    
Actual results:
RPM continues rolling along after the first rpm fails.

Expected results:
I would like it to be configured such that if specified it will
rollback the transaction.


Additional info:

Comment 1 James Olin Oden 2003-05-21 15:30:04 UTC
Created attachment 91862 [details]
Patch to cause rpm to conditioinally rollback a transaction on a failure.

Here are things that are not right yet:

   - failed rpms are not rolled back (i.e. failure in %post), but the
     rest still are.  Saved for a future enhancement.
   - I am only finding the repackaged package by the current transaction
     elements NEVRA; I should be checking REMOVETID against INSTALLTID, but
     I figured I would save that for a future enhancement.

Comment 2 James Olin Oden 2003-06-08 00:32:54 UTC
Created attachment 92245 [details]
The one that works (-;

Finally, got it working.  The main change is I am actually looking in the
repackage dir with IDTXglob() and matching REMOVETID's to INSTALLTID's.
Course there were other changes.  You can pick up a test harness fo this 
at:

   http://lee.k12.nc.us/~joden/misc/patches/rpm/

Thanks...james

Comment 3 James Olin Oden 2003-09-08 17:34:04 UTC
Created attachment 94309 [details]
Fixes problem with instance count passed to scriptlets

Hi Jeff,

I got the instance counts correct when running an autorollback.
This required me to generate another little data structure called 
rpmtsScore that kept a status of the state of an rpm by name (not NEVR).
With this information available to the autorollback transaction I could
make the proper adjustments to the instance counts.

Its a whole lot more complicated than that (I sure wish I could have
figured out a way to make it simpler), so I will attach a little note that
in detail describes what I did to make the scriptlet count correct in an 
autorollback.

Comment 4 James Olin Oden 2003-09-08 17:49:53 UTC
Created attachment 94310 [details]
Description of instance count correction algorithm used with autorollback transactions.

Comment 5 James Olin Oden 2003-10-14 01:55:31 UTC
Created attachment 95146 [details]
I broke --test with the patch...its fixed now.

This revised patch disables the building of the auto-rollback transaction 
if the transaction is being run in test mode (i.e. --test was specified on
the cli).  I also had a typo on my transaction type flags (-;

Cheers...james

Comment 6 James Olin Oden 2004-03-05 21:22:35 UTC
The patch has been worked into the HEAD of the rpm cvs, so from my 
standpoint this bug can be marked as fixed.

Cheers...james

Comment 7 Jeremy Katz 2005-04-19 18:56:17 UTC
Closing per the last comment


Note You need to log in before you can comment on or make changes to this bug.