Issue #3016
closedRemoval of an Artifact leaves repo with associated artifactless Content forever
Description
Steps to reproduce:
- create repo
- create importer with immediate policy
- sync
- remove Artifact by its id, e.g.
http://127.0.0.1:8000/api/v3/artifacts/0585cddf-0782-47b2-886b-ba08d2cad163/
Observe no records in pulp_app_artifact
, pulp_app_contentartifact
, pulp_app_remoteartifact
for the deleted Artifact (because of ON_CASCADE
delete).
All the Content-related tables stay untouched => repository claims to have all the content.
Key attributes of deleted Artifact are left in pulp_file_filecontent
(path
and digest
).
I don't think that importer is expected to recover from this state with a subsequent sync (e.g. RemoreArtifact doesn't exist for the deleted Artifact, so if this content no longer exists in the upstream repo + sync mode is additive, this artifactless Content will remain in repo.
Workaround: explicitly delete related Content.
Updated by dkliban@redhat.com about 7 years ago
Did you remove teh Artifact using REST API or directly in the database?
I don't think we want to allow the REST API for deleting Artifacts to support deletion of an Artifact if it belongs to Content that is associated with a repository.
Updated by ttereshc about 7 years ago
Using REST API: http DELETE http://127.0.0.1:8000/api/v3/artifacts/0585cddf-0782-47b2-886b-ba08d2cad163/
Updated by ttereshc about 7 years ago
- Priority changed from Normal to High
- Severity changed from 2. Medium to 3. High
- Triaged changed from No to Yes
Updated by mhrivnak about 7 years ago
Agreed with all.
Is there a use case where we do want to enable Artifact deletion through the API? Or can we just disable that entirely?
Updated by ipanova@redhat.com about 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ipanova@redhat.com
Updated by jortel@redhat.com about 7 years ago
- Sprint/Milestone changed from 45 to 46
Updated by ttereshc almost 7 years ago
- Assignee changed from ipanova@redhat.com to ttereshc
Updated by ttereshc almost 7 years ago
- Status changed from ASSIGNED to POST
Added by ttereshc almost 7 years ago
Added by ttereshc almost 7 years ago
Revision 4f896e25 | View on GitHub
Delete an Artifact only if it is not associated with any Content
Updated by ttereshc almost 7 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|4f896e2570b644b75012d59e7cc43568470c5807.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Delete an Artifact only if it is not associated with any Content
closes #3016 https://pulp.plan.io/issues/3016