Bug 91325 - Need rpm to rollback failed transactions automatically.
Need rpm to rollback failed transactions automatically.
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-21 10:32 EDT by James Olin Oden
Modified: 2007-04-18 12:53 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-19 14:56:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to cause rpm to conditioinally rollback a transaction on a failure. (18.42 KB, patch)
2003-05-21 11:30 EDT, James Olin Oden
no flags Details | Diff
The one that works (-; (24.58 KB, patch)
2003-06-07 20:32 EDT, James Olin Oden
no flags Details | Diff
Fixes problem with instance count passed to scriptlets (39.30 KB, patch)
2003-09-08 13:34 EDT, 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 13:49 EDT, James Olin Oden
no flags Details
I broke --test with the patch...its fixed now. (39.46 KB, patch)
2003-10-13 21:55 EDT, James Olin Oden
no flags Details | Diff

  None (edit)
Description James Olin Oden 2003-05-21 10:32:08 EDT
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 11:30:04 EDT
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-07 20:32:54 EDT
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 13:34:04 EDT
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 13:49:53 EDT
Created attachment 94310 [details]
Description of instance count correction algorithm used with autorollback transactions.
Comment 5 James Olin Oden 2003-10-13 21:55:31 EDT
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 16:22:35 EST
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 14:56:17 EDT
Closing per the last comment

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