Bug 800525

Summary: CDS unassociated repos don't get cleaned up on sync
Product: [Retired] Pulp Reporter: scressi
Component: nodesAssignee: Jeff Ortel <jortel>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 1.1.0CC: jortel, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: Sprint 34   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 801113 952912 (view as bug list) Environment:
Last Closed: 2012-05-25 14:14:12 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: 801113, 952912    

Description scressi 2012-03-06 16:32:08 UTC
Description of problem:

CDS unassociated repos don't get cleaned up upon CDS repo sync

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

1.0

How reproducible:

Very reproducible

Steps to Reproduce:
1. pulp-admin -u admin -p admin cds associate_repo --repoid=puppet --hostname=pulpcds
2. pulp-admin -u admin -p admin cds  sync --hostname=pulpcds
3. cd /var/lib/pulp-cds/repos/repo/puppet/epel/6Server/x86_64
4. pulp-admin -u admin -p admin cds unassociate_repo --repoid=puppet --hostname=pulpcds
5. pulp-admin -u admin -p admin cds  sync --hostname=pulpcds
6. cd /var/lib/pulp-cds/repos/repo/puppet/epel/6Server/x86_64

Actual results:

unassociated repos in /var/lib/pulp still exist after cds repo sync

Expected results:

repos should be cleaned up, otherwise disk space on all CDSs increases forever for repos it doesn't control

Additional info:

Comment 1 Jeff Ortel 2012-04-24 16:10:56 UTC
The CDS stored sync'd repository data in /var/lib/pulp-cds/ (not /var/lib/pulp) but the problem remains the same.  Entries in /var/lib/pulp-cds/.cds_repo_list need to be corrected to include the 'repos' subdir.

hash: 1f52c49d459ed20c8971724147e961aa438df467

Comment 2 Jeff Ortel 2012-04-26 19:59:57 UTC
build: 1.1.5

Comment 3 Preethi Thomas 2012-04-27 17:50:22 UTC
verified
[root@pulp-v1-1-server ~]# rpm -q pulp
pulp-1.1.5-1.fc16.noarch
[root@pulp-v1-1-server ~]# 

[root@pulp-v1-1-server ~]# pulp-admin repo create --id zoo --feed http://inecas.fedorapeople.org/fakerepos/zoo/
Successfully created repository [ zoo ]

[root@pulp-v1-1-server ~]# pulp-admin repo sync --id zoo -F
Sync for repository zoo started
Sync: Finished
32/32 new items downloaded
0/32 existing items processed

Item Details: 
RPMs: 32/32

[root@pulp-v1-1-server ~]# 
[root@pulp-v1-1-server ~]# 
[root@pulp-v1-1-server ~]# 
[root@pulp-v1-1-server ~]# 
[root@pulp-v1-1-server ~]# 
[root@pulp-v1-1-server ~]# pulp-admin -u admin -p admin cds associate_repo --hostname=pulp-v1-cds.usersys.redhat.com --repoid=zoo
Successfully associated CDS [pulp-v1-cds.usersys.redhat.com] with repo [zoo]

[root@pulp-v1-1-server ~]# pulp-admin -u admin -p admin cds sync --hostname=pulp-v1-cds.usersys.redhat.com -
Sync for CDS [pulp-v1-cds.usersys.redhat.com] started
Use "cds status" to check on the progress

[root@pulp-v1-cds ~]# ls -l /var/lib/pulp-cds/repos/
total 4
drwxr-sr-x. 3 root apache 4096 Apr 27 13:29 fakerepos
[root@pulp-v1-cds ~]# ls -l /var/lib/pulp-cds/repos/
total 4
drwxr-sr-x. 3 root apache 4096 Apr 27 13:29 fakerepos
[root@pulp-v1-cds ~]# ls -l /var/lib/pulp-cds/repos/fakerepos/
total 4
drwxr-sr-x. 3 root apache 4096 Apr 27 13:29 zoo
[root@pulp-v1-cds ~]# ls -l /var/lib/pulp-cds/repos/fakerepos/zoo/
bear-4.1-1.noarch.rpm          kangaroo-0.2-1.noarch.rpm
camel-0.1-1.noarch.rpm         lion-0.4-1.noarch.rpm
cat-1.0-1.noarch.rpm           mouse-0.1.12-1.noarch.rpm
cheetah-1.25.3-5.noarch.rpm    penguin-0.9.1-1.noarch.rpm
chimpanzee-0.21-1.noarch.rpm   pike-2.2-1.noarch.rpm
cockateel-3.1-1.noarch.rpm     repodata/
cow-2.2-3.noarch.rpm           shark-0.1-1.noarch.rpm
crow-0.8-1.noarch.rpm          squirrel-0.1-1.noarch.rpm
dog-4.23-1.noarch.rpm          stork-0.12-2.noarch.rpm
dolphin-3.10.232-1.noarch.rpm  tiger-1.0-4.noarch.rpm
duck-0.6-1.noarch.rpm          trout-0.12-1.noarch.rpm
elephant-8.3-1.noarch.rpm      walrus-0.71-1.noarch.rpm
fox-1.1-2.noarch.rpm           walrus-5.21-1.noarch.rpm
frog-0.1-1.noarch.rpm          whale-0.2-1.noarch.rpm
giraffe-0.67-2.noarch.rpm      wolf-9.4-2.noarch.rpm
gorilla-0.62-1.noarch.rpm      zebra-0.1-2.noarch.rpm
horse-0.22-2.noarch.rpm        


[root@pulp-v1-1-server ~]# 
[root@pulp-v1-1-server ~]# pulp-admin -u admin -p admin cds unassociate_repo --hostname=pulp-v1-cds.usersys.redhat.com --repoid=zoo
Successfully unassociated repo [zoo] from CDS [pulp-v1-cds.usersys.redhat.com]

[root@pulp-v1-1-server ~]# pulp-admin -u admin -p admin cds sync --hostname=pulp-v1-cds.usersys.redhat.com 
Sync for CDS [pulp-v1-cds.usersys.redhat.com] started
Use "cds status" to check on the progress

[root@pulp-v1-1-server ~]# 

[root@pulp-v1-cds ~]# ls -l /var/lib/pulp-cds/repos/
total 4
drwxr-sr-x. 2 root apache 4096 Apr 27 13:43 fakerepos
[root@pulp-v1-cds ~]# 
[root@pulp-v1-cds ~]# 
[root@pulp-v1-cds ~]# 
[root@pulp-v1-cds ~]# ls -l /var/lib/pulp-cds/repos/fakerepos/
total 0

Comment 4 Preethi Thomas 2012-05-25 14:14:12 UTC
Pulp v1.1 Release