Project

Profile

Help

Issue #9363

closed

cleaning up orphans doesn't work

Added by wheezer over 2 years ago. Updated over 2 years ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Hi,

when deleting an rpm repository I'd expect pulp orphan cleanup to purge all artifacts from that repository unless linked elsewhere. Yet this command does nothing.

Using pulp_rpm 3.15.0 with pulp_core 3.15.2.

How to reproduce:

  1. start a fresh container
mkdir -p "${basedir}"/{settings,pulp_storage,pgsql/data,containers}
cat > "${basedir}/settings/settings.py" <<EOF
CONTENT_ORIGIN='http://$(hostname):8080'
ANSIBLE_API_HOSTNAME='http://$(hostname):8080'
ANSIBLE_CONTENT_HOSTNAME='http://$(hostname):8080/pulp/content'
TOKEN_AUTH_DISABLED=True
EOF

podman run --detach \
        --publish 8080:80 \
        --name pulp \
        --volume "${basedir}/settings":/etc/pulp:Z \
        --volume "${basedir}/pulp_storage":/var/lib/pulp:Z \
        --volume "${basedir}/pgsql":/var/lib/pgsql:Z \
        --volume "${basedir}/containers":/var/lib/containers:Z \
        --device /dev/fuse \
        pulp/pulp
  1. create and populate an rpm repository
pulp rpm remote create \
	--name remote-testrepo \
	--url https://rspamd.com/rpm-stable/centos-8/x86_64/
pulp rpm repository create \
	--name testrepo \
	--description "a mirrored repository" \
	--remote remote-testrepo \
	--retain-package-versions 1
pulp rpm repository sync --name testrepo
  1. take a look at what we have
pulp artifact list | jq -r '.[]|.pulp_href'
# /pulp/api/v3/artifacts/7738e5bb-1069-435c-8b1e-acc4a22f7a4d/
# /pulp/api/v3/artifacts/e750dc8c-af81-4a46-84d8-451650a81396/
# /pulp/api/v3/artifacts/34bfa210-b9e4-4426-af85-911c8491f187/

pulp content list | jq -r '.[]|.artifacts|keys[]'
# rspamd-debuginfo-3.0-2.x86_64.rpm
# rspamd-3.0-2.x86_64.rpm
# rspamd-debugsource-3.0-2.x86_64.rpm
  1. destroy everything
pulp rpm repository destroy --name testrepo
pulp rpm remote destroy --name remote-testrepo
  1. run the cleanup job
pulp orphan cleanup
# {
#   "state": "completed",
#   "name": "pulpcore.app.tasks.orphan.orphan_cleanup",
#   "error": null,
#   "progress_reports": [
#     {
#       "message": "Clean up orphan Content",
#       "code": "clean-up.content",
#       "state": "completed",
#       "total": 0,
#       "done": 0,
#       "suffix": null
#     },
#     {
#       "message": "Clean up orphan Artifacts",
#       "code": "clean-up.content",
#       "state": "completed",
#       "total": 0,
#       "done": 0,
#       "suffix": null
#     }
# […]
pulp debug task-summary 
# {
#   "waiting": 0,
#   "skipped": 0,
#   "running": 0,
#   "completed": 6,
#   "failed": 0,
#   "canceled": 0,
#   "canceling": 0
# }
  1. still see the content
pulp artifact list | jq -r '.[]|.pulp_href'
# /pulp/api/v3/artifacts/7738e5bb-1069-435c-8b1e-acc4a22f7a4d/
# /pulp/api/v3/artifacts/e750dc8c-af81-4a46-84d8-451650a81396/
# /pulp/api/v3/artifacts/34bfa210-b9e4-4426-af85-911c8491f187/

pulp content list | jq -r '.[]|.artifacts|keys[]'
# rspamd-debuginfo-3.0-2.x86_64.rpm
# rspamd-3.0-2.x86_64.rpm
# rspamd-debugsource-3.0-2.x86_64.rpm

Also available in: Atom PDF