Bug 1444519 - when you spacewalk-repo-sync into multiple organizations, errata in the satellite have org_id based on last org used (but still being same errata)
Summary: when you spacewalk-repo-sync into multiple organizations, errata in the satel...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Satellite Synchronization
Version: 570
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks: 1340444 1451461
TreeView+ depends on / blocked
 
Reported: 2017-04-21 14:00 UTC by Jan Hutař
Modified: 2017-08-28 10:29 UTC (History)
4 users (show)

Fixed In Version: satellite-schema-5.8.0.27-1-sat spacewalk-schema-2.5.1-46-sat spacewalk-backend-2.5.3-123-sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1451461 (view as bug list)
Environment:
Last Closed: 2017-06-21 12:07:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2017-04-21 14:00:14 UTC
Description of problem:
When you spacewalk-repo-sync into multiple organizations, errata in the satellite have org_id based on last org used (but still being same errata)


Version-Release number of selected component (if applicable):
spacewalk-java-2.3.8-96.el6sat.noarch
satellite-schema-5.7.0.27-1.el6sat.noarch
spacewalk-backend-2.3.3-23.el6sat.noarch


How reproducible:
always


Steps to Reproduce:
1. Create channel A and repo http://dl.fedoraproject.org/pub/epel/6Server/x86_64/ (with filter set to "+freealut*" to make sync faster)
2. Create channel B and sync if from repo with same url&filter but in different organization now
3. Sync channel A in org 1 and channel B in org 2
4. Check in the DB org_id of the errata
5. Sync in org1 again
6. Check in the DB org_id of the errata
 

Actual results:
Errata's org_id is set based on in which organization sync was done last time. Check this (with different package than in steps to reproduce though):

(please ignore that path of packages in org2 does not start with "redhat/2/...", that is different issue)

rhnschema=# select P.id,P.org_id,P.path from rhnPackage P, rhnPackageName PN where P.name_id = PN.id and PN.name = 'powwow-devel';
   id   | org_id |                                                                        path                                                                         
--------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------
 100594 |      1 | redhat/1/6ef/powwow-devel/1.2.16-1.el6/i686/6efc2c1cd00ef2e0e25b15cf36c407d393b31762626e771df471cc72820dc4e6/powwow-devel-1.2.16-1.el6.i686.rpm
 101454 |      1 | redhat/1/468/powwow-devel/1.2.16-1.el6/x86_64/468d1522aec3895b496235f6f3e01d85b48fc71834b9493c5c9a4f734cfe4404/powwow-devel-1.2.16-1.el6.x86_64.rpm
 121766 |      2 | redhat/1/6ef/powwow-devel/1.2.16-1.el6/i686/6efc2c1cd00ef2e0e25b15cf36c407d393b31762626e771df471cc72820dc4e6/powwow-devel-1.2.16-1.el6.i686.rpm
 128010 |      2 | redhat/1/468/powwow-devel/1.2.16-1.el6/x86_64/468d1522aec3895b496235f6f3e01d85b48fc71834b9493c5c9a4f734cfe4404/powwow-devel-1.2.16-1.el6.x86_64.rpm
(4 rows)

rhnschema=# select E.id,E.org_id,E.advisory from rhnErrata E, rhnErrataPackage EP where E.id = EP.errata_id and EP.package_id = 128010;
  id   | org_id |         advisory         
-------+--------+--------------------------
 30232 |      2 | CL-FEDORA-EPEL-2011-0114
 24764 |      2 | FEDORA-EPEL-2011-0114
 41807 |      1 | CM-FEDORA-EPEL-2011-0114
(3 rows)

##### Now we have ran spacewalk-repo-sync -c channel-in-org2-with-same-

rhnschema=# select E.id,E.org_id,E.advisory from rhnErrata E, rhnErrataPackage EP where E.id = EP.errata_id and EP.package_id = 128010;
  id   | org_id |         advisory         
-------+--------+--------------------------
 30232 |      2 | CL-FEDORA-EPEL-2011-0114
 24764 |      1 | FEDORA-EPEL-2011-0114
 41807 |      1 | CM-FEDORA-EPEL-2011-0114
(3 rows)


Expected results:
Maybe there should be 2 errata - one per organization? Or maybe org_id column in rhnErrata is not needed at all? Or this all works/behaves as expected?


Additional info:
This bug is meant for discussion, if this behaviour (2 channels/2 repos (with same url though)/2 same packages in /var/satellite for 2 organizations but only one errata) is sane.

Note this is connected to bug 1444072.

Comment 1 Michael Mráka 2017-05-02 08:23:47 UTC
Fixed in upstream spacewalk git by
commit 2b861e4d90c27061a071db3758c6fceabd983cb7
    1444519 - allow sync of the same erratum to more orgs

Comment 4 Michael Mráka 2017-05-03 14:23:15 UTC
NULL org issue fixed in spacewalk
commit 267d7c275a481390e2be29ac4c116f8ff8d74205
    1444519 - fix index behaviour on NULL org

Comment 7 Michael Mráka 2017-05-04 09:45:33 UTC
Oracle index name fix in spacewalk
commit 4a7ac87ef95c82c7bd6593f58f4a743676f0c0a6
    1444519 - update schema definition and shorten index name

Comment 10 Michael Mráka 2017-05-09 11:20:28 UTC
Fix for cdn-sync
ERROR: duplicate key value violates unique constraint "rhn_errata_advname_uq" DETAIL:  Key (advisory_name)=(RHBA-2015:1776) already exists.

spacewalk git:
commit db1d83698b4370ec3a68640448e9bb70a552c383
    1444519 - org_id column can hold NULL

SATELLITE-5.8:
commit 55dae1263943e4e9eb270fcccb71ad6c19ab2cb6
    1444519 - org_id column can hold NULL


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