Bug 238843 - rhnpush doesn't rollback db transactions during a failure to write to disk
rhnpush doesn't rollback db transactions during a failure to write to disk
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Usability (Show other bugs)
410
All Linux
medium Severity medium
: ---
: ---
Assigned To: Pradeep Kilambi
Preethi Thomas
:
Depends On:
Blocks: 248627
  Show dependency treegraph
 
Reported: 2007-05-03 07:27 EDT by Martin Poole
Modified: 2010-10-22 10:42 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat510
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-02 20:23:38 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)

  None (edit)
Description Martin Poole 2007-05-03 07:27:25 EDT
Description of problem:

If there is an error with the /var/satellite filesystem on the satellite and a
user attempts to publish a package, then the database will be in an inconsistent
state.  A record of the rpm will exist in the database, but the rpm will not
exist in /var/satellite.  What is worse is that the database records are
incomplete, and the rpm does not show up in the webui.

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

How reproducible:

always

Steps to Reproduce:

1. create 32 thousand subdirectories in /var/satellite/redhat/1, that will cause
errors with ext3
2. try to rhnpush a package
3. notice that the package did not make it into the filesystem
4. notice that a record of the rpm exists in the rhnPackage oracle table


Actual results:

reported error, but not all database transactions rolled back

Expected results:

rhnpush throws an error and rolls back all db transactions


Additional info:
Comment 5 Pradeep Kilambi 2007-09-20 17:38:07 EDT
fixed!
Committed revision 132011
Committed revision 132012

create 32000 + directories under /var/satellite/redhat/1 puts the file system in
a state such that any more additional files will get a "oo many links" error.
With this state rhnpush is basically failing to put the package on the
filesystm. But includesa n entry in the db.. this is because packageUpload cal
computes the db entries and populates the db before actually putting the file on
filesystem by reading the package metadata from its header. I fixed the logic
such that it first validates the package on file and then does the db entires.

This is the test after the fix:

create 32000+ dirs under /var/satellite/redhat/1
[root@rlx-0-22 ~]# ls -l /var/satellite/redhat/1/ |wc -l
31999

[root@rlx-0-22 ~]# mkdir /var/satellite/redhat/1/asm/
mkdir: cannot create directory `/var/satellite/redhat/1/asm/': Too many links

so its in a stale state..

now try uploading a package

[root@rlx-0-22 rhnpush]# rhnpush --server=rlx-0-22.rhndev.redhat.com --username
admin --password redhat --channel=test-push ~/asm-1.4.1-2jpp.noarch.rpm
-vvvvConnecting to http://rlx-0-22.rhndev.redhat.com/APP
url is http://rlx-0-22.rhndev.redhat.com/PACKAGE-PUSH
Result codes: 200 OK
Computing md5sum and package Info .This may take sometime ...
%%%%%%%%%%%%%%%%%%%%%%%%%
Package /root/asm-1.4.1-2jpp.noarch.rpm Not Found on RHN Server -- Uploading
Uploading package /root/asm-1.4.1-2jpp.noarch.rpm
Using POST request
Internal server error 500 Internal Server Error

Error pushing /root/asm-1.4.1-2jpp.noarch.rpm: Error Message:
    Package upload failed: [Errno 31] Too many links: '/var/satellite/redhat/1/asm'
Error Class Code: 50
Error Class Info: Invalid information uploaded to the server (500)
[root@rlx-0-22 rhnpush]#

so the push failed.

lets check the filesystem,
[root@rlx-0-22 ~]# ls /var/satellite/redhat/1/asm
ls: /var/satellite/redhat/1/asm: No such file or directory

so it failed to put it on file system

Now check the db:

SQL> select 1 from rhnPackageName where name = 'asm';

no rows selected

SQL>

So there is no trace of asm package in the db's rhnpackageName which means its
not in the db

This should fix the issue Goldman is facing.

Comment 6 Preethi Thomas 2007-10-01 10:38:56 EDT
verified. 
rhn-satellite-5.1.0-8-redhat-linux-as-i386-4-embedded-oracle.iso
Comment 7 Issue Tracker 2007-12-06 17:57:49 EST
this hotfix needs to be for 

SERVER:
rhns-4.2.2-3.noarch 

CLIENT:
rhnpush-4.2.2-3.noarch 

We will update our rhn infrastructure to this version.




This event sent from IssueTracker by vzlatkin 
 issue 120145
Comment 8 Michael Mráka 2007-12-12 08:52:36 EST
Committed revision 134812.
Comment 9 Brandon Perkins 2008-04-02 20:23:38 EDT
5.1 Sat GA so Closed for Current Release.
Comment 10 Brandon Perkins 2008-04-14 17:15:05 EDT
Removed Bug 238843 blocks bug 421541.

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