Bug 82028

Summary: Rollback for transaction containing partial package fails
Product: Red Hat Enterprise Linux 2.1 Reporter: James Olin Oden <james.oden>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED UPSTREAM QA Contact: Mike McLean <mikem>
Severity: high Docs Contact:
Priority: high    
Version: 2.1CC: dmaley, tao
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-29 19:00:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description James Olin Oden 2003-01-16 15:05:24 UTC
Description of problem:

If you install several packages as one trasaction and one 
of the packages to be installed fails in its %post scriptlet, 
when you go to rollback this transaction none of the upgraded
packages will rollback.  The implication is that the rollback feature
is only useful if everything goes OK.

Also, note that the expected behavior is that the sucessfully 
installed RPM's would be able to be rolled back, but the 
partial packages would not be.  Instead no packages can be 
rolled back; it is as if that transaction was never recorded 
in the RPM database.

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


How reproducible:  Every Time


Steps to Reproduce:

Given packages A and B where package A is set to exit with a positive
error code in its %post scriptlet.

1.  Run:

       rpm -Uvh --repackage A B

    This will fail, but B will be successfully installed.

2.  Try to rollback to an hour ago:

       rpm -Fvh --rollback '1 hour ago'
    
Actual results:

Provided no other rpm transactions have occured in the last hour
nothing will happen; neither A or B will be rolled back.

Expected results:

I expected B to be rolled back, and A to be left on the system.

Additional info:

This bug is related to enhancement request 82024, where a request
to be able query for partially installed packages has been made.
The relation is, even if this bug is fixed, a method to find out
what packages were partially installed is still necessary.

Comment 5 Jeremy Katz 2005-04-19 18:41:27 UTC
James -- is this resolved in newer releases (I seem to remember you had a patch
for it once upon a time)?

Comment 6 James Olin Oden 2005-04-19 19:33:29 UTC
No it was never resolved officially.  I created the autorollback patch which 
rollback the failed transaction automatically.  I have a set of patches for 
RHEL 3 which we use in production:

   http://lee.k12.nc.us/~joden/misc/patches/rpm/patches/latest/4.2.3-10/

But AFAIK if you don't use this patch, or enable the feature, a failed 
transaction cannot be rolled back properly.

Also, those patches are in the HEAD of rpm.

Cheers...james

Comment 8 Paul Nasrat 2005-09-29 19:00:34 UTC
Improved rollback in rpm HEAD/4.4.x branches.  This is not going to get
backported to AS 2.1 as it is in maintenance mode atm.