[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rollback hosed by install/upgrade without --repackage...



If one installed a package or two without --repackage, I would assume
that if one later used the --rollback option to go back to a time previous the 
update/install of these packages, these packages that were not installed/upgraded
with the --repackage option would not be part of the rollback.  And in this
case my assumptions hold true.  What I find troubling is that any other rpm 
transactions previous to the install of these rogue packages and post
the rollback date, are not rolled back.  It is as if the first time someone
installs or upgrades without --repackage, any knowledge of transactions 
previous to this rogue transaction is forgotten.  This I find most disconcerting.

The here is an example test:

	#
	# First install of normal rpm
	rpm -Uvvh normal-1.0-1.noarch.rpm 2> log.initial

	#
	# Upgrade with --repackage...
	TDATE=$(date '+%m/%d/%Y %H:%M:%S')
	echo "Transaction time is ${TDATE}..."
	sleep 3
	rpm -Uvvh --repackage normal-1.1-1.noarch.rpm 2> log.upgrade

	#
	# Show what transactional rollback would do...
	rpm -Fvvh --test --rollback "${TDATE}" 2> log.rollback.1

	#
	# Add an rpm to the system without --repackage
	rpm -Uvvh --repackage another-1.0-1.noarch.rpm 2> log.another

	#
	# Show transactional rollback after installing another package without
	# --repackage.
	rpm -Fvvh --test --rollback "${TDATE}" 2> log.rollback.2


The log.rollback.1 log shows:

	D: opening  db environment /var/lib/rpm/Packages create:mpool
	D: opening  db index       /var/lib/rpm/Packages  mode=0x2
	D: locked   db index       /var/lib/rpm/Packages
	D: opening  db index       /var/lib/rpm/Installtid  mode=0x2
	D: Expected size:         1268 = lead(96)+sigs(128)+pad(0)+data(1044)
	D:   Actual size:         1288
	D: Expected size:         1260 = lead(96)+sigs(128)+pad(0)+data(1036)
	D:   Actual size:         1280
	D: Expected size:         1320 = lead(96)+sigs(128)+pad(0)+data(1096)
	D:   Actual size:         1340
	D:      +++ normal-1.0-1        (from normal-1.0-1.noarch.rpm)
	D:      --- normal-1.1-1        (from rpmdb instance #2080)
	D: rollback (+1,-1) packages to Mon Jan 27 11:17:11 2003
	D: ========== +++ normal-1.0-1
	D: opening  db index       /var/lib/rpm/Depends create mode=0x2
	D:   YES    A rpmlib(VersionedDependencies) <= 3.0.3-1  B rpmlib(VersionedDependencies) = 3.0.3-1
	D:  Requires: rpmlib(VersionedDependencies) <= 3.0.3-1      YES (rpmlib provides)
	D:   NO     A rpmlib(PayloadFilesHavePrefix) <= 4.0-1   B rpmlib(VersionedDependencies) = 3.0.3-1
	D:   NO     A rpmlib(PayloadFilesHavePrefix) <= 4.0-1   B rpmlib(CompressedFileNames) = 3.0.4-1
	D:   NO     A rpmlib(PayloadFilesHavePrefix) <= 4.0-1   B rpmlib(PayloadIsBzip2) = 3.0.5-1
	D:   YES    A rpmlib(PayloadFilesHavePrefix) <= 4.0-1   B rpmlib(PayloadFilesHavePrefix) = 4.0-1
	D:  Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1       YES (rpmlib provides)
	D:   NO     A rpmlib(CompressedFileNames) <= 3.0.4-1    B rpmlib(VersionedDependencies) = 3.0.3-1
	D:   YES    A rpmlib(CompressedFileNames) <= 3.0.4-1    B rpmlib(CompressedFileNames) = 3.0.4-1
	D:  Requires: rpmlib(CompressedFileNames) <= 3.0.4-1        YES (rpmlib provides)
	D: opening  db index       /var/lib/rpm/Conflictname  mode=0x2
	D: ========== --- normal-1.1-1
	D: opening  db index       /var/lib/rpm/Requirename  mode=0x2
	D: closed   db index       /var/lib/rpm/Depends
	D: ========== recording tsort relations
	D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
	D:     0    0    0    0    0  normal-1.0-1
	error: failed to stat /view/rbubnis3_prototype_platform_4.0/vobs/software/platform: Stale NFS file handle
	D: opening  db index       /var/lib/rpm/Name  mode=0x2
	D: Expected size:         1268 = lead(96)+sigs(128)+pad(0)+data(1044)
	D:   Actual size:         1288
	D:   install: normal-1.0-1 has 0 files, test = 1
	D:     erase: normal-1.1-1 has 0 files, test = 1
	D: closed   db index       /var/lib/rpm/Installtid
	D: verified db index       /var/lib/rpm/Installtid
	D: closed   db index       /var/lib/rpm/Conflictname
	D: verified db index       /var/lib/rpm/Conflictname
	D: closed   db index       /var/lib/rpm/Requirename
	D: verified db index       /var/lib/rpm/Requirename
	D: closed   db index       /var/lib/rpm/Name
	D: verified db index       /var/lib/rpm/Name
	D: closed   db index       /var/lib/rpm/Packages
	D: closed   db environment /var/lib/rpm/Packages
	D: removed  db environment /var/lib/rpm/Packages
	D: verified db index       /var/lib/rpm/Packages

	
This is of course the log showing that the transaction still exists (i.e. it would be
rolled back).  The log after the upgrade, log.rollback.1, shows a different
story:

	D: opening  db environment /var/lib/rpm/Packages create:mpool
	D: opening  db index       /var/lib/rpm/Packages  mode=0x2
	D: locked   db index       /var/lib/rpm/Packages
	D: opening  db index       /var/lib/rpm/Installtid  mode=0x2
	D: Expected size:         1268 = lead(96)+sigs(128)+pad(0)+data(1044)
	D:   Actual size:         1288
	D: Expected size:         1260 = lead(96)+sigs(128)+pad(0)+data(1036)
	D:   Actual size:         1280
	D: Expected size:         1320 = lead(96)+sigs(128)+pad(0)+data(1096)
	D:   Actual size:         1340
	D: closed   db index       /var/lib/rpm/Installtid
	D: verified db index       /var/lib/rpm/Installtid
	D: closed   db index       /var/lib/rpm/Packages
	D: closed   db environment /var/lib/rpm/Packages
	D: removed  db environment /var/lib/rpm/Packages
	D: verified db index       /var/lib/rpm/Packages

The story here is that there is transaction to rollback.  As soon as I perform
another upgrade with --repackage, the database then again seems to keep track of
transactions.  

I do realize that someone doing this is problematic, because dependencies that 
could cause the rollback to fail could be introduced.  If the rogue package
introduced such a dependency I would find it acceptable for the transactional
rollback to fail at that point (what's a program to do?).  On the other
hand if this did not occur, I would hope that the rollback would be attempted.
Obviously, my assumptions are wrong, but is this really how you wish things to work?

Cheers...james





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []