Issue #3016
Removal 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.
Associated revisions
Revision 4f896e25
View on GitHub
Delete an Artifact only if it is not associated with any Content
History
#1
Updated by dkliban@redhat.com over 3 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.
#2
Updated by ttereshc over 3 years ago
Using REST API: http DELETE http://127.0.0.1:8000/api/v3/artifacts/0585cddf-0782-47b2-886b-ba08d2cad163/
#3
Updated by ttereshc over 3 years ago
- Priority changed from Normal to High
- Severity changed from 2. Medium to 3. High
- Triaged changed from No to Yes
#4
Updated by mhrivnak over 3 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?
#5
Updated by mhrivnak over 3 years ago
- Sprint/Milestone set to 45
#6
Updated by ipanova@redhat.com over 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ipanova@redhat.com
#7
Updated by jortel@redhat.com over 3 years ago
- Sprint/Milestone changed from 45 to 46
#8
Updated by mhrivnak about 3 years ago
- Sprint/Milestone changed from 46 to 47
#9
Updated by ttereshc about 3 years ago
- Assignee changed from ipanova@redhat.com to ttereshc
#10
Updated by rchan about 3 years ago
- Sprint/Milestone changed from 47 to 48
#11
Updated by daviddavis about 3 years ago
- Tags Pulp 3 MVP added
#12
Updated by ttereshc about 3 years ago
- Status changed from ASSIGNED to POST
#13
Updated by ttereshc about 3 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|4f896e2570b644b75012d59e7cc43568470c5807.
#14
Updated by bmbouter almost 3 years ago
- Sprint set to Sprint 29
#15
Updated by bmbouter almost 3 years ago
- Sprint/Milestone deleted (
48)
#16
Updated by dkliban@redhat.com almost 3 years ago
- Sprint/Milestone set to 3.0.0
#17
Updated by bmbouter over 1 year ago
- Tags deleted (
Pulp 3, Pulp 3 MVP)
#18
Updated by bmbouter about 1 year ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Please register to edit this issue
Delete an Artifact only if it is not associated with any Content
closes #3016 https://pulp.plan.io/issues/3016