Bug 701829

Summary: Removing all repos from a CDS doesn't properly clean up the CDS
Product: [Retired] Pulp Reporter: Jay Dobies <jason.dobies>
Component: nodesAssignee: Jay Dobies <jason.dobies>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecified   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 12:10:16 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: 647488, 688298    

Description Jay Dobies 2011-05-04 01:32:38 UTC
I'm pretty sure I already filed a bug to more gracefully handle when a repo delete fails on the CDS.

We keep a list of repos on the CDS so we can cross reference that against repos in a sync request to determine what to delete. We then use that info to delete the repo directory. That part works.

That file with the list of deployed repos is updated when the sync occurs. That part works too.

The caveat is that the file is only updated if there was at least one repo in the sync request (the updating is done inside the loop of repos). In other words, if repos were deployed and then all repos were removed from the CDS, it will delete their contents but not update that file to indicate there are no deployed repos.

That really breaks things on the CDS because of the first line in this description (i.e. if an attempted delete fails, everything tanks).

Comment 1 Jay Dobies 2011-05-09 20:16:17 UTC
commit 9229d8fbcd8aff38e333c27714406d7dc7e0fa77
Author: Jay Dobies <jason.dobies>
Date:   Mon May 9 16:18:18 2011 -0400

    701829 - Clear the repo listing file on empty syncs and delete_all calls

src/pulp/cds/cdslib.py



The big thing to check for in verifying this is that when repos are unassociated from a CDS (and a sync is called on that CDS) the repo path does not appear in the file on the CDS /var/lib/pulp-cds/cds_repo_list. Make sure to check this for CDS unregisters as well.

Comment 2 Jeff Ortel 2011-05-09 22:25:19 UTC
build 0.174

Comment 3 Preethi Thomas 2011-05-12 14:16:11 UTC
[root@preethi ~]# rpm -q pulp
pulp-0.0.174-1.fc14.noarch


[root@preethi ~]# pulp-admin cds unassociate_repo --hostname=pulp-cds.usersys.redhat.com --repoid=repos-pulp-pulp-fedora-14-i386
Successfully unassociated repo [repos-pulp-pulp-fedora-14-i386] from CDS [pulp-cds.usersys.redhat.com]

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

[root@pulp-cds ~]# cat /var/lib/pulp-cds/cds_repo_list 
repos/pulp/pulp/fedora-14/x86_64
pub/updates
repos/pulp/pulp/fedora-14/i386
[root@pulp-cds ~]# cat /var/lib/pulp-cds/cds_repo_list 
repos/pulp/pulp/fedora-14/x86_64
pub/updates

Comment 4 Preethi Thomas 2011-08-16 12:10:16 UTC
Closing with Community Release 15

pulp-0.0.223-4.

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

pulp-0.0.223-4.