Bug 486401

Summary: Satellite sync while syncing arch information with hosted, deletes some 'sun4v' related rows in database
Product: Red Hat Satellite 5 Reporter: Sayli Karmarkar <skarmark>
Component: Satellite SynchronizationAssignee: Pradeep Kilambi <pkilambi>
Status: CLOSED CURRENTRELEASE QA Contact: Sayli Karmarkar <skarmark>
Severity: high Docs Contact:
Priority: high    
Version: 530CC: bperkins, cperry, james.leddy, jpazdziora, mzazrivec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:41:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 238435, 457000    

Description Sayli Karmarkar 2009-02-19 16:24:51 UTC
Description of problem:
Satellite sync while syncing arch information with hosted, deletes some 'sun4v' related rows in database. 

Rows from following tables are deleted:

rhnChannelPackageArchCompat
rhnServerChannelArchCompat
rhnServerPackageArchCompat
rhnServerServerGroupArchCompat

Version-Release number of selected component (if applicable):
Satellite-5.3.0-RHEL5-re20090213.1-i386-embedded-oracle.iso

Steps to Reproduce:
1. Install satellite with this ISO.
2. Check following queries in the database:

select * from rhnChannelPackageArchCompat where package_arch_id=LOOKUP_PACKAGE_ARCH('sparc.sun4v-solaris');

select * from rhnServerChannelArchCompat where server_arch_id=LOOKUP_SERVER_ARCH('sparc-sun4v-solaris');

select * from rhnServerPackageArchCompat where package_arch_id=LOOKUP_PACKAGE_ARCH('sparc.sun4v-solaris');

select * from rhnServerPackageArchCompat where server_arch_id=LOOKUP_SERVER_ARCH('sparc-sun4v-solaris');

select * from rhnServerServerGroupArchCompat where server_arch_id=lookup_server_arch('sparc-sun4v-solaris');

Each of them will return some data. 

3. Start sat-sync. Just after sat-sync has completed retrieving/parsing arches and additional arches data. Check in the database again and these queries will return "no rows selected" 

Expected results:
  
They should not be deleted and shoult return same result as before sat-sync. 
We are guessing whats happening is while syncing arch information, hosted does not have 'sun4v' compatibility rows and its deleting the ones that exist in the database. 

So, we should either add same compatibility in hosted or skip these rows when syncing arches data during sat-sync. 


~SayliK

Comment 1 Milan Zázrivec 2009-02-19 16:42:01 UTC
Exactly the same thing (sun4v data being flushed from the db) was
happenning to me when I did the following:

1) registered a sun4v machine to my satellite
2) disassociated my machine from its (custom) base channel
3) deleted machine profile

Comment 13 Brandon Perkins 2009-08-18 05:05:33 UTC
Fixed in WebQA.  Please re-verify.

Comment 14 Sayli Karmarkar 2009-08-18 18:32:21 UTC
Reverified. 

After sat-sync against webqa, 


SQL> select CHANNEL_ARCH_ID, PACKAGE_ARCH_ID from rhnChannelPackageArchCompat minus select CHANNEL_ARCH_ID, PACKAGE_ARCH_ID from rhnChannelPackageArchCompat_b ;

no rows selected

SQL> select CHANNEL_ARCH_ID, PACKAGE_ARCH_ID from rhnChannelPackageArchCompat_b minus select CHANNEL_ARCH_ID, PACKAGE_ARCH_ID from rhnChannelPackageArchCompat ;

no rows selected

SQL> select id, label, name from rhnCpuArch minus select id, label, name from rhnCpuArch_b ;

no rows selected

SQL> select id, label, name from rhnCpuArch_b minus select id, label, name from rhnCpuArch ;

no rows selected

SQL> select SERVER_ARCH_ID, CHANNEL_ARCH_ID from rhnServerChannelArchCompat minus select SERVER_ARCH_ID, CHANNEL_ARCH_ID from rhnServerChannelArchCompat_b ;

no rows selected

SQL> select SERVER_ARCH_ID, CHANNEL_ARCH_ID from rhnServerChannelArchCompat_b minus select SERVER_ARCH_ID, CHANNEL_ARCH_ID from rhnServerChannelArchCompat ;

no rows selected

SQL> select SERVER_ARCH_ID, SERVER_GROUP_TYPE from rhnServerServerGroupArchCompat minus select SERVER_ARCH_ID, SERVER_GROUP_TYPE from rhnServerServerGroupArchComp_b ;

no rows selected

SQL> select SERVER_ARCH_ID, SERVER_GROUP_TYPE from rhnServerServerGroupArchComp_b minus select SERVER_ARCH_ID, SERVER_GROUP_TYPE from rhnServerServerGroupArchCompat ;

no rows selected

SQL> select SERVER_ARCH_ID, PACKAGE_ARCH_ID, PREFERENCE from rhnServerPackageArchCompat minus select SERVER_ARCH_ID, PACKAGE_ARCH_ID, PREFERENCE from rhnServerPackageArchCompat_b ;

no rows selected

SQL> select SERVER_ARCH_ID, PACKAGE_ARCH_ID, PREFERENCE from rhnServerPackageArchCompat_b minus select SERVER_ARCH_ID, PACKAGE_ARCH_ID, PREFERENCE from rhnServerPackageArchCompat ;

no rows selected


No rows are being deleted expected. Moving to verified.

Comment 15 Brandon Perkins 2009-08-19 17:40:45 UTC
Fixed in Stage.  Please re-verify.

Comment 16 Sayli Karmarkar 2009-08-20 20:16:57 UTC
Validated on Satellite-5.3.0-RHEL5-re20090819.0-i386-embedded-oracle.iso. 

SQL> select * from rhnChannelPackageArchCompat where
package_arch_id=LOOKUP_PACKAGE_ARCH('sparc.sun4v-solaris');
  2  
CHANNEL_ARCH_ID PACKAGE_ARCH_ID CREATED   MODIFIED
--------------- --------------- --------- ---------
	    510 	    124 20-AUG-09 20-AUG-09

SQL> select * from rhnServerChannelArchCompat where
server_arch_id=LOOKUP_SERVER_ARCH('sparc-sun4v-solaris');

  2  
SERVER_ARCH_ID CHANNEL_ARCH_ID CREATED	 MODIFIED
-------------- --------------- --------- ---------
	  1022		   510 20-AUG-09 20-AUG-09

SQL> SQL> select * from rhnServerPackageArchCompat where
package_arch_id=LOOKUP_PACKAGE_ARCH('sparc.sun4v-solaris');
  2  
SERVER_ARCH_ID PACKAGE_ARCH_ID PREFERENCE CREATED   MODIFIED
-------------- --------------- ---------- --------- ---------
	  1020		   124	      100 20-AUG-09 20-AUG-09
	  1022		   124	       10 20-AUG-09 20-AUG-09

SQL> select * from rhnServerPackageArchCompat where
server_arch_id=LOOKUP_SERVER_ARCH('sparc-sun4v-solaris');

  2  
SERVER_ARCH_ID PACKAGE_ARCH_ID PREFERENCE CREATED   MODIFIED
-------------- --------------- ---------- --------- ---------
	  1022		   122	      100 20-AUG-09 20-AUG-09
	  1022		   124	       10 20-AUG-09 20-AUG-09
	  1022		   130	      210 20-AUG-09 20-AUG-09
	  1022		   132	      310 20-AUG-09 20-AUG-09
	  1022		   134	      410 20-AUG-09 20-AUG-09
	  1022		   135	      510 20-AUG-09 20-AUG-09
	  1022		   136	      610 20-AUG-09 20-AUG-09

7 rows selected.

SQL> SQL> select * from rhnServerServerGroupArchCompat where
server_arch_id=lookup_server_arch('sparc-sun4v-solaris');
  2  
SERVER_ARCH_ID SERVER_GROUP_TYPE CREATED   MODIFIED
-------------- ----------------- --------- ---------
	  1022		       2 20-AUG-09 20-AUG-09
	  1022		       3 20-AUG-09 20-AUG-09

------------------------------------------------------------------------
Created duplicate tables.

Satsync against stage: 
# satellite-sync --no-rpms --no-packages --no-errata --no-kickstarts -c rhel-i386-as-4

-----------------------------------------------------------------------
SQL> select CHANNEL_ARCH_ID, PACKAGE_ARCH_ID from rhnChannelPackageArchCompat minus select CHANNEL_ARCH_ID, PACKAGE_ARCH_ID from rhnChannelPackageArchCompat_b ;

no rows selected

SQL> select CHANNEL_ARCH_ID, PACKAGE_ARCH_ID from rhnChannelPackageArchCompat_b minus select CHANNEL_ARCH_ID, PACKAGE_ARCH_ID from rhnChannelPackageArchCompat ;

no rows selected

SQL> select id, label, name from rhnCpuArch minus select id, label, name from rhnCpuArch_b ;

no rows selected

SQL> select id, label, name from rhnCpuArch_b minus select id, label, name from rhnCpuArch ;

no rows selected

SQL> select SERVER_ARCH_ID, CHANNEL_ARCH_ID from rhnServerChannelArchCompat minus select SERVER_ARCH_ID, CHANNEL_ARCH_ID from rhnServerChannelArchCompat_b ;

no rows selected

SQL> select SERVER_ARCH_ID, CHANNEL_ARCH_ID from rhnServerChannelArchCompat_b minus select SERVER_ARCH_ID, CHANNEL_ARCH_ID from rhnServerChannelArchCompat ;

no rows selected

SQL> select SERVER_ARCH_ID, SERVER_GROUP_TYPE from rhnServerServerGroupArchCompat minus select SERVER_ARCH_ID, SERVER_GROUP_TYPE from rhnServerServerGroupArchComp_b ;

no rows selected

SQL> select SERVER_ARCH_ID, SERVER_GROUP_TYPE from rhnServerServerGroupArchComp_b minus select SERVER_ARCH_ID, SERVER_GROUP_TYPE from rhnServerServerGroupArchCompat ;

no rows selected

SQL> select SERVER_ARCH_ID, PACKAGE_ARCH_ID, PREFERENCE from rhnServerPackageArchCompat minus select SERVER_ARCH_ID, PACKAGE_ARCH_ID, PREFERENCE from rhnServerPackageArchCompat_b ;

no rows selected

SQL> select SERVER_ARCH_ID, PACKAGE_ARCH_ID, PREFERENCE from rhnServerPackageArchCompat_b minus select SERVER_ARCH_ID, PACKAGE_ARCH_ID, PREFERENCE from rhnServerPackageArchCompat ;

no rows selected

Comment 17 Brandon Perkins 2009-09-10 19:41:03 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