Bug 670891 - Orphaned packages (no longer in a repo) are left on the server
Summary: Orphaned packages (no longer in a repo) are left on the server
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: Sprint 21
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-01-19 15:44 UTC by Jay Dobies
Modified: 2011-08-16 12:21 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:08:14 UTC
Embargoed:


Attachments (Terms of Use)

Description Jay Dobies 2011-01-19 15:44:20 UTC
Snippets from an e-mail conversation:

> Take the following scenario:
> - - Create a repo and synchronize it. It brings in packages A, B, and C.
> - - Delete the repo.
> - - Do a `pulp-admin package search`
>
> Packages A, B, and C all show up from the package search, indicating
> they have no repository.
>
> - - Is there a use case for keeping them around in Pulp if they aren't in
> a repository? Arguably that would make a future sync that would download
> those packages faster since they already exist, but is that the intention?
>
> - - Is there a way to purge those packages? For instance, say a Pulp
> installation used to mirror Fedora 12 but gave up on it when Fedora 14
> came out. How do we reclaim all of that space on the Pulp server's hard
> disk and/or clean out those packages from the database?

----

Hmm.  I thought the desired behavior was to delete the packages and associated rpms off of the filesystem if the packages are no longer associated with a repository.

-Todd 

----

Without knowing much of anything - my view on this is...

We should allow a way to purge at time of delete. Most likely default behavior should be is to remove orphaned packages and to allow you to override to keep.

Cliff

Comment 1 Sayli Karmarkar 2011-01-27 02:45:45 UTC
Yes. We do need to provide a way of overrriding to keep orphaned packages considering a following RFE: 

https://bugzilla.redhat.com/show_bug.cgi?id=649765

Comment 2 Pradeep Kilambi 2011-02-22 22:54:47 UTC
I addressed this as part of CDN story.

The behavior is as follows:

* when you delete a repo, if the package associated to that repo are not part of any other repo, we remove those packages.

* There is a keep_files option on delete api if you chose to keep the files. default is to nuke

* If a package is uploaded without associating to a repo, use content delete to remove these orphaned packages

pulp-admin content delete -f foo.rpm -f test.iso

or

pulp-admin content list --orphaned > orphaned.csv
pulp-admin content delete --csv=orphaned.csv

Comment 3 Jeff Ortel 2011-02-23 17:59:57 UTC
Build: 0.141

Comment 4 Preethi Thomas 2011-03-07 19:54:30 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.144-1.fc14.noarch


[root@preethi ~]# pulp-admin content list --orphaned >orphaned.csv
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin content delete -csv=orphaned.csv
Usage: pulp-admin <options> content delete <options>

pulp-admin: error: no such option: -c
[root@preethi ~]# pulp-admin content delete --csv=orphaned.csv
Successfully delete content [grinder-0.0.81-1.fc14.noarch.rpm] from pulp server
Successfully delete content [gofer-0.20-1.fc14.noarch.rpm] from pulp server
Content with filename [grinder-0.0.81-1.noarch.rpm.1] could not be found on server; skipping delete
Successfully delete content [pulp-cds-0.0.143-1.fc14.noarch.rpm] from pulp server
Successfully delete content [antlr-2.7.7-6.fc12.x86_64.rpm] from pulp server

Comment 5 Preethi Thomas 2011-08-16 12:08:14 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 6 Preethi Thomas 2011-08-16 12:21:23 UTC
Closing with Community Release 15

pulp-0.0.223-4.


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