Project

Profile

Help

Story #1111

As an API user, I can purge completed task status records

Added by mhrivnak over 6 years ago. Updated over 1 year ago.

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

100%

Estimated time:
Platform Release:
2.8.0
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Pulp 2
Sprint:
Quarter:

Description

I suggest adding support for the DELETE method on this endpoint: https://pulp.readthedocs.org/en/latest/dev-guide/integration/rest-api/dispatch/task.html#listing-tasks

And require query args that limit it to final states. For example:

DELETE - https://mypulp/pulp/api/v2/tasks/?state=finished&state=error

If a request has no query args or specifies a non-final state, the response should be a 403.

Questions

  • Should this be done asynchronously? Mongo is probably real fast at dropping records, but is it fast enough? I'd start with doing it synchronously if we can't answer the questions quickly.
  • Can we safely delete tasks in the "cancelled" state? How can we know that the task isn't in the process of being cancelled? Maybe we can look at the "finish_time"?

Checklist


Related issues

Related to Pulp - Story #229: Add new task state: cancel_requestedCLOSED - WONTFIX

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocks Pulp - Story #228: As a pulp-admin user, I can purge completed task recordsCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 05693454 View on GitHub
Added by sbhawsin over 6 years ago

Story 1111: Purge completed task status records

https://pulp.plan.io/issues/1111

closes #1111

Revision 05693454 View on GitHub
Added by sbhawsin over 6 years ago

Story 1111: Purge completed task status records

https://pulp.plan.io/issues/1111

closes #1111

History

#1 Updated by mhrivnak over 6 years ago

  • Blocks Story #228: As a pulp-admin user, I can purge completed task records added

#2 Updated by bmbouter over 6 years ago

  • Checklist item changed from [ ] API endpoint supports DELETE with query parameters to specify final states to [x] API endpoint supports DELETE with query parameters to specify final states

#3 Updated by bmbouter over 6 years ago

  • Checklist item changed from [x] API endpoint supports DELETE with query parameters to specify final states to [ ] API endpoint supports DELETE with query parameters to specify final states

#4 Updated by mhrivnak over 6 years ago

  • Groomed changed from No to Yes

#5 Updated by sbhawsin over 6 years ago

  • Platform Release set to master

#6 Updated by mhrivnak over 6 years ago

Based on team discussion, let's start by doing this synchronously and see how it goes.

Cancellation does not appear to set a value for finish_time, so we can't use that to determine if it's safe to delete. We will need to look more closely at what the best thing is to do. If we delete one that's in the canceled state, it's possible that a worker process is still trying to write progress updates to the task. Maybe the best thing to do is ensure that wherever a task status is updated, it's ok if the object no longer exists and the update fails.

#7 Updated by rbarlow over 6 years ago

  • Blocked by Story #229: Add new task state: cancel_requested added

#8 Updated by rbarlow over 6 years ago

  • Blocked by deleted (Story #229: Add new task state: cancel_requested)

#9 Updated by rbarlow over 6 years ago

  • Related to Story #229: Add new task state: cancel_requested added

#10 Updated by rbarlow over 6 years ago

We have a story about adding a new state called cancel_requested that will track the time between the cancellation request and the successful cancellation of the task. I went ahead and related that story to this story.

If we did #229 first, we'd be able to avoid this problem a little bit. It may still be possible for tasks to get stuck at cancel_requested if the message is missing from the broker somehow.

#11 Updated by sbhawsin over 6 years ago

  • Checklist item changed from [ ] API endpoint supports DELETE with query parameters to specify final states to [x] API endpoint supports DELETE with query parameters to specify final states

#12 Updated by sbhawsin over 6 years ago

  • Checklist item changed from [ ] API endpoint is documented to [x] API endpoint is documented

#13 Updated by sbhawsin over 6 years ago

  • Checklist item changed from [ ] unit tests to [x] unit tests

#14 Updated by sbhawsin over 6 years ago

  • Checklist item changed from [ ] hand-off to QE to [x] hand-off to QE

#15 Updated by sbhawsin over 6 years ago

  • Checklist item changed from [x] hand-off to QE to [ ] hand-off to QE

#16 Updated by sbhawsin over 6 years ago

  • Status changed from ASSIGNED to POST

#18 Updated by sbhawsin over 6 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#19 Updated by mhrivnak about 6 years ago

  • Platform Release changed from master to 2.8.0

#20 Updated by dkliban@redhat.com almost 6 years ago

  • Status changed from MODIFIED to 5

#21 Updated by dkliban@redhat.com over 5 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#22 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

#23 Updated by bmbouter over 1 year ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Please register to edit this issue

Also available in: Atom PDF