Index content does not clean up units the got deleted in pulp
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.