Bug 970795 - Removing a unit from a published ISO repository and then republishing results in the removed unit remaining published
Removing a unit from a published ISO repository and then republishing results...
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: iso-support (Show other bugs)
2.2
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 2.2.0
Assigned To: Randy Barlow
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-04 18:26 EDT by Randy Barlow
Modified: 2013-09-10 11:45 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-10 11:45:22 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Randy Barlow 2013-06-04 18:26:32 EDT
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 17:35:18 EDT
https://github.com/pulp/pulp_rpm/pull/235
Comment 2 Jeff Ortel 2013-06-11 10:15:55 EDT
build: 2.2.0-0.3.beta
Comment 3 Preethi Thomas 2013-06-19 14:07:54 EDT
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 11:45:22 EDT
2.2 released
http://repos.fedorapeople.org/repos/pulp/pulp/stable/2.2/

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