-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting a remote used as source for live content corrupts ContentArtifact records #1975
Comments
From: @dralley (dalley) We should probably introduce an actual constraint that enforces this, so it blows up immediately if it ever occurs. |
From: @dralley (dalley) Recreating the remote and re-syncing does fix the content artifacts, but if you don't notice the problem immediately, or if you copied the content around between repos, it would be practically impossible to know how to resolve the issue. There's some discussion on solutions here: https://hackmd.io/_3gsUVdyQwy50Nc5pMXN-g |
From: @mdellweg (mdellweg) Idea to solve the problem: |
From: @ggainey (ggainey) I'd go for 1c) from the associated hackmd. I wouldn't even give the option of --force - the state your pulp-instance gets left in is pretty horrific, even if you meant to do it. Having some way to list the content/repo-versions/artifacts, or a list of "do an immediate sync on the following repos before attempting" would be great. |
From: @ipanova ([email protected]) during review of a PR there has been raised an idea about what to do with the content that does not have RA not Artifact
EDIT: add a --force flag which can be specified when new repo-version is being created to allow such content |
From: @dralley (dalley) More discussion from the PR I have not manually tested rpm plugin yet, but skimmed through pulpcore code - plugins that use directly pulp's content app handler, should be able to gracefully handle this. Uploaded content will have artifact set to none as well it won't have any remoteartifacts so a 404 will just be raised https://github.com/pulp/pulpcore/blob/master/pulpcore/content/handler.py#L681.
tldr, i think we're fine just need to audit plugins that subclass the Handler. EDIT: some plugins contain content that is expected to always have artifact. We should not touch those content types during reclaim disk space. For example: rpm modules and defaults, container tags, manifests and config blobs.
|
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! |
This issue is no longer marked for closure. |
I am proceeding with option 1c from the attached hackmd document. I have tested the removal of a remote across multiple plugins (pulp_file, pulp_rpm, pulp_python); and, only in pulp_file was a runtime error raised when a publication was getting created without remote artifacts. In the pulp_file repository, I will adjust the code to gracefully handle these kinds of scenarios (just in case):
|
see also #2153 |
@ipanova, thanks for sharing the reference to another issue. It seems like one change can close both the issues. |
The change effectively disables the option of removing remotes before removing a synced repository and associated content. The remotes can be deleted only when there is no content artifact left referencing remote artifact. The change affects repositories that are synced with the on_demand policy. closes pulp#1975
The change effectively disables the option of removing remotes before removing a synced repository and associated content. The remotes can be deleted only when there is no content artifact left referencing a remote artifact. The change affects repositories that are synced with the on_demand policy. closes pulp#1975
The change effectively disables the option of removing remotes before removing a synced repository and associated content. The remotes can be deleted only when there is no content artifact left referencing a remote artifact. The change affects repositories that are synced with the on_demand policy. closes pulp#1975
The change effectively disables the option of removing remotes before removing a synced repository and associated content. The remotes can be deleted only when there is no content artifact left referencing a remote artifact. The change affects repositories that are synced with the on_demand policy. closes pulp#1975
The change effectively disables the option of removing remotes before removing a synced repository and associated content. The remotes can be deleted only when there is no content artifact left referencing a remote artifact. The change affects repositories that are synced with the on_demand policy. closes pulp#1975
The change effectively disables the option of removing remotes via the REST API endpoint. The remotes can be removed via the django-admin interface directly or automatically by the orphan clean-up machinery once they are marked as 'hidden'. closes pulp#1975
As of this commit, users can delete a remote that is referenced by live repository versions (synced with the on_demand policy) only when using the "force" option specified in the body of a DELETE request. closes pulp#1975
As of this commit, users can delete a remote that is referenced by live repository versions (synced with the on_demand policy) only when specifying the "force=True" header in a DELETE request. closes pulp#1975
As of this commit, users can delete a remote that is referenced by live repository versions (synced with the on_demand policy) only when specifying the "force=True" header in a DELETE request. closes pulp#1975
As of this commit, users can delete a remote that is referenced by live repository versions (synced with the on_demand policy) only when specifying the "force=True" header in a DELETE request. closes pulp#1975
As of this commit, users can delete a remote that is referenced by live repository versions (synced with the on_demand policy) only when specifying the "force=True" header in a DELETE request. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users can delete a remote that is referenced by live repository versions (synced with the on_demand policy) only when specifying the "force=True" header in a DELETE request. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users can delete a remote that is referenced by live repository versions (synced with the on_demand policy) only when specifying the "force=True" header in a DELETE request. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users cannot delete a remote that is referenced by live repository versions. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users cannot delete a remote that is referenced by repository versions synced via the on_demand policy. One can delete the remote only if the affected repository versions were removed or there is a redundancy of remote artifacts. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users cannot delete a remote that is referenced by repository versions synced via the on_demand policy. One can delete the remote only if the affected repository versions were removed or there is a redundancy of remote artifacts. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users cannot delete a remote that is referenced by repository versions synced via the on_demand policy or a remote that is currently being attached to a repository. One can delete the remote only if the affected repository versions were removed or there is a redundancy of remote artifacts. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users cannot delete a remote that is referenced by repository versions synced via the on_demand policy or a remote that is currently being attached to a repository. One can delete the remote only if the affected repository versions were removed or there is a redundancy of remote artifacts. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users cannot delete a remote that is referenced by repository versions synced via the on_demand policy or a remote that is currently being attached to a repository. One can delete the remote only if the affected repository versions were removed or there is a redundancy of remote artifacts. Required PR: pulp/pulp_file#756 closes pulp#1975
As of this commit, users cannot delete a remote that is referenced by repository versions synced via the on_demand policy or a remote that is currently being attached to a repository. One can delete the remote only if the affected repository versions were removed or there is a redundancy of remote artifacts. Required PR: pulp/pulp_file#756 Required PR: pulp/pulp-cli#550 closes pulp#1975
This work is put on hold until we resolve a more significant issue: #3212 |
Add a section to the documentation about deleting remotes and hazards of moving on-demand content around between repositories. |
Author: @dralley (dalley)
Redmine Issue: 8305, https://pulp.plan.io/issues/8305
The deletion of the Remote deletes the RemoteArtifacts, leaving behind ContentArtifact attached to neither Artifacts nor Remotes, making them effectively corrupted and unpublishable.
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.
The text was updated successfully, but these errors were encountered: