Bug 970795

Summary: Removing a unit from a published ISO repository and then republishing results in the removed unit remaining published
Product: [Retired] Pulp Reporter: Randy Barlow <rbarlow>
Component: iso-supportAssignee: Randy Barlow <rbarlow>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.2CC: skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-10 15:45:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Randy Barlow 2013-06-04 22:26:32 UTC
I noticed today that if I publish an ISO repository, then remove a unit from it, and then republish the repository, the unit remains published. It is removed from the database, but the HTTP published view of the repository will still show the unit. Interestingly, the PULP_MANIFEST file will no longer list the unit.

I haven't had time to investigate this issue to determine the cause, but here are some steps to reproduce the issue:

# I believe we can't remove units that were provided via a sync, so we'll sync one repo to copy its units to another
$ pulp-admin iso repo create --feed http://pkilambi.fedorapeople.org/test_file_repo/ --repo-id iso_feed
Successfully created repository [iso_feed]

# This is the repo we will copy the units into, and then attempt to remove them
$ pulp-admin iso repo create --repo-id unit_removal
Successfully created repository [unit_removal]

# Sync the first repo
$ pulp-admin iso repo sync run --repo-id iso_feed
+----------------------------------------------------------------------+
                  Synchronizing Repository [iso_feed]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

The Pulp Manifest was downloaded successfully.

Downloading 3 ISOs...
[==================================================] 100%
ISOs: 3/3	Data: 10.2 MB/10.2 MB	Avg: 5.1 MB/s


Successfully downloaded 3 ISOs.

The repository was successfully published.

# Copy all units from the first into the second
$ pulp-admin iso repo copy -f iso_feed -t unit_removal
This command may be exited via ctrl+c without affecting the request.

# Now let's publish the repo
(pulp)[rbarlow@where pulp]$ pulp-admin iso repo publish run --repo-id unit_removal
+----------------------------------------------------------------------+
                  Publishing Repository [unit_removal]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

The repository was successfully published.

# If you browse to https://localhost/pulp/isos/unit_removal/ you should now see three ISOs, and the PULP_MANIFEST should also list all three. This part works.

# Now let's remove test.iso from the repo
(pulp)[rbarlow@where pulp]$ pulp-admin iso repo remove --repo-id unit_removal --match "name=test.iso"
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...

[-]
Running...

Task Succeeded

# Now republish the repo
(pulp)[rbarlow@where pulp]$ pulp-admin iso repo publish run --repo-id unit_removal
+----------------------------------------------------------------------+
                  Publishing Repository [unit_removal]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

The repository was successfully published.

# Now, if you browse to https://localhost/pulp/isos/unit_removal/ you should now see two ISOs, and the PULP_MANIFEST should also list only the two. Instead, you will see three ISOs in the apache view, thought the PULP_MANIFEST will correctly list only the two. This is the problem: they should both only have test2.iso and test3.iso, since we removed test.iso.

In Mongo, I can see that the repo_content_units collection only has two ISOs for this repository:

> db.repo_content_units.find({'repo_id': 'unit_removal'}).count()
2

The fact that the PULP_MANIFEST file only has two units is further evidence that the removal is working fine from Pulp's end, so there must be something wrong with the way we generate the symlinks to be included in the repo in the ISODistributor.

Comment 1 Randy Barlow 2013-06-07 21:35:18 UTC
https://github.com/pulp/pulp_rpm/pull/235

Comment 2 Jeff Ortel 2013-06-11 14:15:55 UTC
build: 2.2.0-0.3.beta

Comment 3 Preethi Thomas 2013-06-19 18:07:54 UTC
verified

[root@ibm-x3550m3-13 ~]# rpm -q pulp-server
pulp-server-2.2.0-0.4.beta.fc18.noarch
[root@ibm-x3550m3-13 ~]# 

[root@ibm-x3550m3-13 ~]#  pulp-admin iso repo create --feed http://pkilambi.fedorapeople.org/test_file_repo/ --repo-id iso_feed
Successfully created repository [iso_feed]

[root@ibm-x3550m3-13 ~]#  pulp-admin iso repo create --repo-id unit_removal
Successfully created repository [unit_removal]

[root@ibm-x3550m3-13 ~]# pulp-admin iso repo sync run --repo-id iso_feed
+----------------------------------------------------------------------+
                  Synchronizing Repository [iso_feed]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading the Pulp Manifest...
The Pulp Manifest was downloaded successfully.

Downloading 3 ISOs...
[==================================================] 100%
ISOs: 3/3	Data: 10.2 MB/10.2 MB	Avg: 283.7 kB/s


Successfully downloaded 3 ISOs.

The repository was successfully published.

[root@ibm-x3550m3-13 ~]# pulp-admin iso repo copy -f iso_feed -t unit_removal
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...

[-]
Running...

Task Succeeded


[root@ibm-x3550m3-13 ~]# pulp-admin iso repo publish run --repo-id unit_removal
+----------------------------------------------------------------------+
                  Publishing Repository [unit_removal]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

The repository was successfully published.

[root@ibm-x3550m3-13 ~]# pulp-admin iso repo remove --repo-id unit_removal --match "name=test.iso"
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...

[-]
Running...

Task Succeeded


[root@ibm-x3550m3-13 ~]# pulp-admin iso repo publish run --repo-id unit_removal
+----------------------------------------------------------------------+
                  Publishing Repository [unit_removal]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

The repository was successfully published.

[root@ibm-x3550m3-13 ~]#

verified that the units removed doesn't remain published

Comment 4 Preethi Thomas 2013-09-10 15:45:22 UTC
2.2 released
http://repos.fedorapeople.org/repos/pulp/pulp/stable/2.2/