Issue #9363
closedcleaning up orphans doesn't work
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:
- 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
- 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
- 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
- destroy everything
pulp rpm repository destroy --name testrepo
pulp rpm remote destroy --name remote-testrepo
- 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
# }
- 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
Updated by ipanova@redhat.com about 2 years ago
please look into this new setting https://docs.pulpproject.org/pulpcore/configuration/settings.html?highlight=orphan_protection_time#orphan-protection-time It keeps orphans by default for 24 hours. You can change that.
To give more background - this setting has been introduced to enable oprhan clean up tasks to run in parallel with other tasks that might be using those content units, rather than blocking the entire system.
Updated by wheezer about 2 years ago
Thanks, that was the cause. My bad. Sorry. Can I close this issue somehow?
Updated by dalley about 2 years ago
- Status changed from NEW to CLOSED - NOTABUG
No worries, it was an understandable confusion (and it is a change from the behavior of previous versions)