Bug 503243 - Syncing more than two eus channels for same RHEL release causes unique constraint traceback
Summary: Syncing more than two eus channels for same RHEL release causes unique constr...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Satellite Synchronization
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Pradeep Kilambi
QA Contact: Michael Mráka
URL:
Whiteboard:
Depends On:
Blocks: 456985 502915
TreeView+ depends on / blocked
 
Reported: 2009-05-29 20:29 UTC by Pradeep Kilambi
Modified: 2009-09-10 20:37 UTC (History)
2 users (show)

Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-10 20:37:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pradeep Kilambi 2009-05-29 20:29:10 UTC
Description of problem:

Here is the problem, 
* we currently have a unique constraint on rhnReleaseChannelMap for product, version, channel_arch_id, is_default. So if we have more than 2 eus channels for the same RHEL it will fail as is_default is the only unique value. 

*Now sync  rhel-x86_64-server-5.3.z, rhel-x86_64-server-5.2.z and rhel-x86_64-server-5.1.z, product-version-channel_arch_id are same for all three channels, but is_default is 'Y' for one(newest) and 'N' for the other two causing the unique constraint. 

* Now we need another unique column, So to support all available eus channels for the same RHEL on satellite, rhnreleasechannelmap should perhaps include 'release' as well in the unique constraint which would be 5.2.0.2 or 5.3.0.3 etc. This way we can drop is_default from db and include release instead and let your patch decide the is_default. 

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

How reproducible:
always

Steps to Reproduce:
1. satellite-sync -c rhel-x86_64-server-5.3.z -c rhel-x86_64-server-5.2.z -c rhel-x86_64-server-5.1.z
11:48:49 Red Hat Network Satellite - live synchronization
11:48:49    url: https://satellite.rhn.webqa.redhat.com
11:48:49    debug/output level: 5
11:48:49    +++ Satellite synchronization tool checking in.
11:48:49    +++ Entitled satellite validated.
11:48:49    db:  rhnsat/<password>@rhnsat
...

(Check logs/email for potentially more detail)

<rhnFault class (code = 54, text = 'ORA-00001: unique constraint (RHNSAT.RHN_RCM_PVA_DEF_UNIQ) violated
')>
(54, 'ORA-00001: unique constraint (RHNSAT.RHN_RCM_PVA_DEF_UNIQ) violated\n', '\n     Package Upload Failed due to uniqueness constraint violation.\n     Make sure the package does not have any duplicate dependencies or\n     does not already exists on the server\n     ')
  
Basically what needs to happen is:

We need to support the hosted ported changes from bug#356951(which are currently in master not vader).

1. DB Changes:
 - Drop is_default column
 - Drop unique constraint on product,version,channel_arch_id,is_default
 - Add unique constraint on product,version,channel_arch_id,release instead

2. Backend Changes:
 - Fix satellite-sync and exporter to exclude the is_default from the import and export queries and take into account the release.

Comment 1 Pradeep Kilambi 2009-05-29 20:30:49 UTC
btw this has been the case since we added eus support looks like. I get the same result on 5.2 satellite as well. So its not a regression. But bug#356951 and this one should go into the same release if possible.

Comment 3 Michael Mráka 2009-06-10 14:24:24 UTC
Verified. 

# satellite-sync -m. -c rhel-i386-as-4.6.z -c rhel-i386-as-4.7.z -c rhel-i386-server-5.0.z -c rhel-i386-server-5.2.z
13:17:33 Red Hat Network Satellite - file-system synchronization
13:17:33    mp:  /mnt/hostel/export/sputnik-prod
13:17:33    db:  xen74/<password>@sat10g
...
13:17:36    base-channels:
13:17:36       . rhel-i386-as-4.6.z                       5565
13:17:36       . rhel-i386-as-4.7.z                       6422
13:17:36       . rhel-i386-server-5.0.z                   2470
13:17:36       . rhel-i386-server-5.2.z                   4573
13:17:36
13:17:37 Channel data complete
....

Comment 4 Miroslav Suchý 2009-08-20 11:45:19 UTC
# satellite-sync -c rhel-i386-server-5.0.z -c rhel-i386-server-5.1.z                          
runs without problem
verified in stage

Comment 5 Brandon Perkins 2009-09-10 20:37:34 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html


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