Project

Profile

Help

Issue #3016

Removal of an Artifact leaves repo with associated artifactless Content forever

Added by ttereshc about 2 years ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
3. High
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 29

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
Added by ttereshc almost 2 years ago

Delete an Artifact only if it is not associated with any Content

closes #3016
https://pulp.plan.io/issues/3016

Revision 4f896e25 View on GitHub
Added by ttereshc almost 2 years ago

Delete an Artifact only if it is not associated with any Content

closes #3016
https://pulp.plan.io/issues/3016

Revision 4f896e25 View on GitHub
Added by ttereshc almost 2 years ago

Delete an Artifact only if it is not associated with any Content

closes #3016
https://pulp.plan.io/issues/3016

History

#1 Updated by dkliban@redhat.com about 2 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 about 2 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 about 2 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 about 2 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 about 2 years ago

  • Sprint/Milestone set to 45

#6 Updated by ipanova@redhat.com about 2 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com

#7 Updated by jortel@redhat.com almost 2 years ago

  • Sprint/Milestone changed from 45 to 46

#8 Updated by mhrivnak almost 2 years ago

  • Sprint/Milestone changed from 46 to 47

#9 Updated by ttereshc almost 2 years ago

  • Assignee changed from ipanova@redhat.com to ttereshc

#10 Updated by rchan almost 2 years ago

  • Sprint/Milestone changed from 47 to 48

#11 Updated by daviddavis almost 2 years ago

  • Tags Pulp 3 MVP added

#12 Updated by ttereshc almost 2 years ago

  • Status changed from ASSIGNED to POST

#13 Updated by ttereshc almost 2 years ago

  • Status changed from POST to MODIFIED

#14 Updated by bmbouter over 1 year ago

  • Sprint set to Sprint 29

#15 Updated by bmbouter over 1 year ago

  • Sprint/Milestone deleted (48)

#16 Updated by dkliban@redhat.com over 1 year ago

  • Sprint/Milestone set to 3.0

#17 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3, Pulp 3 MVP)

Please register to edit this issue

Also available in: Atom PDF