Bug 645694 - Need taskomatic job to purge unreferenced records from rhnPackageChangeLogData
Summary: Need taskomatic job to purge unreferenced records from rhnPackageChangeLogData
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.2
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space13
TreeView+ depends on / blocked
 
Reported: 2010-10-22 09:24 UTC by Jan Pazdziora
Modified: 2011-02-08 08:42 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-08 08:42:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2010-10-22 09:24:47 UTC
Description of problem:

For Spacewalk 1.2, we have split rhnPackageChangeLog into rhnPackageChangeLogData (the data) and rhnPackageChangeLogRec (the relation table which links the data to individual package).

Whe package is deleted, so is record from rhnPackageChangeLogRec. However, the record from rhnPackageChangeLogData does not get deleted because it might be referenced from other packages, and for performance reasons we don't do that lookup right away.

We need daily taskomatic task which will do something like

    delete from rhnPackageChangeLogData
    where id not in ( select changelog_data_id from rhnPackageChangeLogRec )

There is index on rhnPackageChangeLogRec(changelog_data_id) so it should be pretty fast.

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

spacewalk-schema-1.2.46-1

How reproducible:

Should be easy.

Steps to Reproduce:
1. Push or sync a package.
2. Check that there are records in rhnPackageChangeLogRec and rhnPackageChangeLogData.
3. Remove that package.
4. Check that the records from rhnPackageChangeLogRec are gone but records in rhnPackageChangeLogData are still there.
5. Wait a day.
  
Actual results:

Records in rhnPackageChangeLogData are still there.

Expected results:

Orphaned records got purged from rhnPackageChangeLogData.

Additional info:

Comment 1 Tomas Lestach 2010-11-15 14:05:38 UTC
Introducing cleanup-packagechangelog-data task
    
    this task is scheduled once a day together with another clean up task
    and cleans up unreferenced records from the rhnPackageChangeLogData table

spacewalk.git: 6c1ee1ef54b4593b406cb111b0b86cc1a3c12949

Comment 2 Tomas Lestach 2011-02-03 12:21:41 UTC
Moving ON_QA ...

Comment 3 Tomas Lestach 2011-02-08 08:42:06 UTC
This bug has been fixed in Spacewalk 1.3.


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