RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 809375 - yum history order deformation by changed date
Summary: yum history order deformation by changed date
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: Hubert Kario
URL:
Whiteboard:
Depends On: 809373
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-03 08:29 UTC by Patrik Kis
Modified: 2014-06-13 13:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 809373
Environment:
Last Closed: 2014-06-13 13:03:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Patrik Kis 2012-04-03 08:29:50 UTC
+++ This bug was initially created as a clone of Bug #809373 +++

Description of problem:
When the system time is changed the yum history order follows the system time and not the order how the commands were performed.

Version-Release number of selected component (if applicable):
yum-3.2.29-27.el6.noarch

How reproducible:
always

Steps to Reproduce:

1. Clean the history database and install a package
# yum history new
# date
Mon Apr  3 10:02:10 CEST 2056
# yum -y install zsh

2. Change the system time back and install another package
# date 040306`date +%M`
Mon Apr  3 06:02:00 CEST 2056
# yum -y install shed

3. Change the system time again back to the original and install another package
# date 040310`date +%M`
Mon Apr  3 10:02:00 CEST 2056
# yum -y install xs

4. Check the history
# yum history
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     1 | root <root>              | 2056-04-03 10:02 | Install        |    1   
     3 | root <root>              | 2056-04-03 10:02 | Install        |    1   
     2 | root <root>              | 2056-04-03 06:02 | Install        |    1   
Warning: RPMDB altered outside of yum.

5. Display the info about the "last" history entry
# yum history info
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Transaction ID : 1
Begin time     : Mon Apr  3 10:02:30 2056
Begin rpmdb    : 655:dcb936703b97c9addadc75e7817d771f302efa27
End time       :            10:02:34 2056 (4 seconds)
End rpmdb      : 654:d5f844407840619c1cb3360e069420dc42156b9d **
User           : root <root>
Return-Code    : Success
Command Line   : -y install zsh
Transaction performed with:
    Installed     rpm-4.8.0-19.el6.x86_64                   @anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2
    Installed     subscription-manager-0.96.17-1.el6.x86_64 @anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2
    Installed     yum-3.2.29-22.el6.noarch                  @anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2
    Installed     yum-metadata-parser-1.1.2-16.el6.x86_64   @anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2
Packages Altered:
    Install zsh-4.3.10-4.1.el6.x86_64 @rhel62s

6. Try to redo/undo the last transaction
# yum history undo last
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Undoing transaction 1, from Mon Apr  3 10:02:30 2056
    Install zsh-4.3.10-4.1.el6.x86_64 @rhel62s

7. 
# yum history rollback 3
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Rollback to transaction 3, from Mon Apr  3 10:02:08 2056
  Undoing the following transactions: 1, 2, 3
    Install shed-1.15-5.el6.x86_64         @epel
    Install xs-0.1-2.git9c19777.el6.x86_64 @epel
    Install zsh-4.3.10-4.1.el6.x86_64      @rhel62s

# yum history rollback 2
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Rollback to transaction 2, from Mon Apr  3 06:02:18 2056
  Undoing the following transactions: 1, 2, 3
    Install shed-1.15-5.el6.x86_64         @epel
    Install xs-0.1-2.git9c19777.el6.x86_64 @epel
    Install zsh-4.3.10-4.1.el6.x86_64      @rhel62s

# yum history rollback 1
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Rollback to current, nothing to do


Actual results:
4. The history list is ordered by actual system time, while the "natural order" would be by ID, i.e. in which order each action took place.
5. The top entry from list is picked up, i.e. the one with newest system time, but not the one which was last performed. Event though it is not explicitly mentioned in man page or other document that this command will pick the last performed action, I'd say this is what people expect.
6. Again the last transaction by system time is picked, and not with highest ID. Man page says "Eg. if you’ve done 250 transactions, "last" refers to transaction 250 ..."
7. The rollback is screwed up too. Rollback to 2 and 3 seems to do the same and it is including itself too. Rollback to 1 is taken as the last transaction.

Expected results:
4. The history is ordered by transaction ID.
5. The history entry with highest transaction ID is shown.
6. The history entry with highest transaction ID is undone/redone..
7. As explained in man page: rollback to 1 rolls back 2 and 3, etc.

Additional info:

Comment 1 James Antill 2012-04-03 15:04:26 UTC
Fix upstream, one liner:

commit b070ced387a670b4fe1440f5e6ae086fe6e5ef3b
Author: James Antill <james>
Date:   Thu Oct 13 10:35:05 2011 -0400

    Ignore time skew by using sqlite IDs instead to order transactions. BZ
745635

Comment 4 James Antill 2012-11-12 19:42:20 UTC
 I assume the fix should be in RHEL-7 by now.

Comment 6 Ludek Smid 2014-06-13 13:03:41 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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