Project

General

Profile

Bug #21414

Index content does not clean up units the got deleted in pulp

Added by Partha Aji almost 2 years ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Repositories
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

The import_all call for db units does not delete units that got wiped out in Pulp. Using SRPMs as example here but this is true of any unit type RPM, PackageGroups, Errata etc

  • Sync a source rpm repo (I synced https://dl.fedoraproject.org/pub/epel/7/SRPMS/ but any repo will do.. Counts will be different)
  • Delete that repo via UI
  • Now in the rails console try this test
    > ::Katello::RepositorySrpm.count
    => 0  # Good! no repos with srpms
    > ::Katello::Srpm.count
    => 3842 # I guess I needed to run clean up orphans
    
  • Run the the clean up
    $ rake katello:delete_orphan_content
    .....
    
  • get back to rails console
    > ::Katello::Srpm.import_all
    => ....... 1 rest call later which tells me there are no srpms
    
    > ::Katello::Srpm.count
    => 3842
    # Tells me SRPM count is not getting changed even if upstream pulp says there no source rpms
    ```
    I also know pulp srpm is clear here because I checked in mongo
    ```
    $ mongo pulp_database
    > db.units_rpm.count()
    8636
    
    > db.units_srpm.count()
    0
    

So if the indexing operation worked correctly we should have 0 Srpms.


Related issues

Related to Katello - Bug #21415: orphaned content units are not cleaned up from the databaseDuplicate2017-10-20

History

#1 Updated by Justin Sherrill almost 2 years ago

  • Related to Bug #21415: orphaned content units are not cleaned up from the database added

#2 Updated by Justin Sherrill almost 2 years ago

  • Legacy Backlogs Release (now unused) set to 114

Also available in: Atom PDF