Project

Profile

Help

Story #3226

closed

Story #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

Added by dkliban@redhat.com over 6 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 32
Quarter:

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

Blocked by Pulp - Task #3222: Add 'complete' attribute to the RepositoryVersion modelCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions

Also available in: Atom PDF