Story #3226
closedStory #3209: As a user, I have Repository Versions
As a user, I am guaranteed that my incomplete repository versions are cleaned up after a crash
100%
Description
Motivation¶
A RepositoryVersion that has complete=False and experiences an error will be deleted by core, then exception will be reraised, and the user will see the exception in the task failure. In the event of a crash though, we have no mechanism to clean up the incomplete RepositoryVersion. This would be an area of improvement.
Design¶
Storing crash info for cleanup later¶
The created_resources
field stores a reference to the created RepositoryVersion
. Any time a RepositoryVersion is created, it needs to be saved as a created_resources
object in the same transaction.
Cleaning up¶
Update the task cleanup code to delete any task.created_resources.filter(complete=False)
That worker already holds the necessary locks to make this operation safe so it just needs to make sure to perform the deletions before deleting the corresponding ReservedResource records.
created_resources only show resources with completed=True¶
A saved reference in created_resources
is only visible on the Task's viewset or filterset if completed=True.
Files
Related issues
Updated by bmbouter almost 7 years ago
- Description updated (diff)
Rewriting based on recent discussion on the list.
Updated by daviddavis almost 7 years ago
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
Updated by dkliban@redhat.com almost 7 years ago
- Blocked by Task #3222: Add 'complete' attribute to the RepositoryVersion model added
Updated by bmbouter almost 7 years ago
- Description updated (diff)
Rewriting after discussion on the design w/ other core devs
Updated by daviddavis almost 7 years ago
I think we need to also handle the case where the task has failed and has already been cleaned up (removed). We should therefore probably remove repo versions that have no task associated (via created_resources) and are complete=False.
Added a checklist item for this case.
Updated by daviddavis almost 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
Updated by daviddavis almost 7 years ago
- Status changed from ASSIGNED to NEW
- Assignee deleted (
daviddavis)
I'm on vacation. Will pick this back up on Jan 29th if someone doesn't beat me to it.
Updated by jortel@redhat.com almost 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to jortel@redhat.com
Updated by jortel@redhat.com almost 7 years ago
daviddavis@redhat.com wrote:
I think we need to also handle the case where the task has failed and has already been cleaned up (removed). We should therefore probably remove repo versions that have no task associated (via created_resources) and are complete=False.
Added a checklist item for this case.
If the CreatedResource.task=NULL, how can it be determined that the task failed?
Updated by jortel@redhat.com almost 7 years ago
- Sprint/Milestone changed from 53 to 54
Updated by jortel@redhat.com almost 7 years ago
- Status changed from ASSIGNED to POST
Added by jortel@redhat.com almost 7 years ago
Added by jortel@redhat.com almost 7 years ago
Revision ef428607 | View on GitHub
Clean up incomplete created-resources. closes #3226
Updated by jortel@redhat.com almost 7 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|ef428607c69942b01a52dd77a10dce45e113291a.
Updated by Anonymous about 5 years ago
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Clean up incomplete created-resources. closes #3226