Project

Profile

Help

Issue #8305

closed

Deleting a remote used as source for live content corrupts ContentArtifact records

Added by dalley about 3 years ago. Updated over 2 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 112
Quarter:

Description

Ticket moved to GitHub: "pulp/pulpcore/1975":https://github.com/pulp/pulpcore/issues/1975


  • Create a repository and on_demand remote, and sync them.
  • Delete the remote

The deletion of the Remote deletes the RemoteArtifacts, leaving behind ContentArtifact attached to neither Artifacts nor Remotes, making them effectively corrupted and unpublishable.

# create repository, remote
remote = remote_api.create(gen_file_remote(policy='on_demand'))
repo = repo_api.create(gen_repo())

# sync the repository
repository_sync_data = RepositorySyncURL(remote=remote.pulp_href)
sync_response = repo_api.sync(repo.pulp_href, repository_sync_data)
task = monitor_task(sync_response.task)

# delete the remote
monitor_task(remote_api.delete(remote.pulp_href).task)

# ^---- problem occurs here, now RemoteArtifacts deleted, now ContentArtifact is broken

publish_response = publications_api.create({"repository_version": task.created_resources[0]})
monitor_task(publish_response.task)  # boom publish failure

This is more pernicious because content units can move throughout repositories, and if the remote is ever deleted, every repo can be broken at once with no safeguards.


Files

reproduce_publish_error.py (1.28 KB) reproduce_publish_error.py dalley, 02/25/2021 08:58 PM

Related issues

Related to Pulp - Issue #9101: Content_artifact is not updatedCLOSED - CURRENTRELEASEgerrodActions
Has duplicate Ansible Plugin - Issue #7924: Sync doesn't create RemoteArtifactsCLOSED - DUPLICATEActions

Also available in: Atom PDF