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 almost 7 years ago. Updated almost 5 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
Actions #1

Updated by dkliban@redhat.com almost 7 years ago

  • Parent issue set to #3209
Actions #2

Updated by bmbouter almost 7 years ago

  • Description updated (diff)

Rewriting based on recent discussion on the list.

Actions #3

Updated by bmbouter almost 7 years ago

  • Description updated (diff)
Actions #4

Updated by daviddavis almost 7 years ago

  • Groomed changed from No to Yes
  • Sprint Candidate changed from No to Yes
Actions #5

Updated by dkliban@redhat.com almost 7 years ago

  • Blocked by Task #3222: Add 'complete' attribute to the RepositoryVersion model added
Actions #6

Updated by bmbouter almost 7 years ago

  • Description updated (diff)

Rewriting after discussion on the design w/ other core devs

Actions #7

Updated by dkliban@redhat.com almost 7 years ago

  • Sprint/Milestone set to 53
Actions #8

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.

Actions #9

Updated by daviddavis almost 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to daviddavis
Actions #10

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.

Actions #11

Updated by jortel@redhat.com almost 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jortel@redhat.com
Actions #12

Updated by jortel@redhat.com almost 7 years ago

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?

Actions #13

Updated by jortel@redhat.com almost 7 years ago

  • Sprint/Milestone changed from 53 to 54
Actions #14

Updated by jortel@redhat.com almost 7 years ago

  • Status changed from ASSIGNED to POST

Added by jortel@redhat.com almost 7 years ago

Revision ef428607 | View on GitHub

Clean up incomplete created-resources. closes #3226

Added by jortel@redhat.com almost 7 years ago

Revision ef428607 | View on GitHub

Clean up incomplete created-resources. closes #3226

Actions #15

Updated by jortel@redhat.com almost 7 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #16

Updated by bmbouter over 6 years ago

  • Sprint set to Sprint 32
Actions #17

Updated by bmbouter over 6 years ago

  • Sprint/Milestone deleted (54)
Actions #18

Updated by dkliban@redhat.com over 6 years ago

  • Sprint/Milestone set to 3.0.0
Actions #19

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3, Pulp 3 MVP)
Actions #21

Updated by bmbouter almost 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF