Story #1268
closedAs a user, orphan content delete reports how many units were deleted
100%
Description
The API DELETE /pulp/api/v2/content/orphans/ will spawn a task to delete content.
These tasks don't seem to report what they actually deleted. As a user it is useful to know what was deleted so the user can validate changes made to the filesystem and storage.
The task should report how many units it deleted of each type.
For example, the task status report could look like this to show that 32 rpms were removed:
{
"exception": null,
"task_type": "pulp.server.managers.content.orphan.delete_all_orphans",
"_href": "/pulp/api/v2/tasks/7b2405ed-ae44-48e7-9d16-6fdcdc0af3f0/",
"task_id": "7b2405ed-ae44-48e7-9d16-6fdcdc0af3f0",
"tags": [
"pulp:content_unit:orphans"
],
"finish_time": "2016-11-04T18:18:46Z",
"_ns": "task_status",
"start_time": "2016-11-04T18:18:46Z",
"traceback": null,
"spawned_tasks": [],
"progress_report": {},
"queue": "celery.dq",
"state": "finished",
"worker_name": "celery",
"result": {
"rpm": 32
},
"error": null,
"_id": {
"$oid": "581cd103e96cb59365cf1133"
},
"id": "581cd103e96cb59365cf1133"
}
Related issues
Updated by mmccune@redhat.com about 9 years ago
The results of a delete are:
{
"exception": null,
"task_type": "pulp.server.managers.content.orphan.delete_all_orphans",
"_href": "/pulp/api/v2/tasks/f2b5b41e-3586-4a8d-a5c7-b991cc0546bc/",
"task_id": "f2b5b41e-3586-4a8d-a5c7-b991cc0546bc",
"tags": [
"pulp:content_unit:orphans"
],
"finish_time": "2015-09-24T14:46:48Z",
"_ns": "task_status",
"start_time": "2015-09-24T14:46:19Z",
"traceback": null,
"spawned_tasks": [
],
"progress_report": {
},
"state": "finished",
"worker_name": "celery",
"result": null,
"error": null,
"_id": {
"$oid": "56040cbb45f9a6f0bb04ee23"
},
"id": "56040cbb45cf5608eda06ec0"
}
What I'm asking for would be some statistics that really could just be a simple count of the number of files deleted but could get more detailed beyond that.
*
Updated by jortel@redhat.com about 9 years ago
- Tracker changed from Issue to Story
- Subject changed from Orphan content delete should report what it deleted to As a user, orphan content delete should report what was deleted
- Groomed set to No
- Sprint Candidate set to No
Updated by mhrivnak about 8 years ago
- Subject changed from As a user, orphan content delete should report what was deleted to As a user, orphan content delete reports how many units were deleted
- Description updated (diff)
Updated by mhrivnak about 8 years ago
I modified the body of the story to orient it toward reporting how many of each unit type was removed. That's a fairly straight-forward change. I was able to throw together a proof-of-concept that produced the sample output in the body above:
https://github.com/pulp/pulp/compare/2.10-dev...mhrivnak:1268?expand=1
Does that meet the need?
If we needed to report details about each unit removed, that could become difficult, because it might be a HUGE list. It could be a lot of data to render, a lot to transfer via HTTP, and way too much to show to a user. But most importantly, it could exceed mongo's document size. We'd need to either truncate the data set (ugly), or batch the work into multiple tasks (lots of work and an API change).
Either way, my thinking is that reporting details of each unit removed would be an order of magnitude more work and complexity that just reporting counts, and it could easily lose its value to the user by becoming an overwhelming amount of data.
Updated by daviddavis about 8 years ago
- Status changed from NEW to ASSIGNED
Pinged a few Katello people just to ask them to confirm that showing the result count would suffice.
Updated by daviddavis about 8 years ago
Looking at the downstream bug, they're actually fine with just getting back the counts.
I tested @mhrivnak's patch and it worked flawlessly. Proceeding with the other items.
Updated by daviddavis about 8 years ago
- Related to Story #2484: As a pulp 3.0 user, orphan content delete reports how many units were deleted added
Updated by daviddavis about 8 years ago
- Status changed from ASSIGNED to POST
Added by daviddavis about 8 years ago
Added by daviddavis about 8 years ago
Revision d427d808 | View on GitHub
As a user, orphan content delete reports how many units were deleted
Track the counts of units being deleted when orphan remove all is executed and store the result indexed by content type id on the task.
Updated by daviddavis about 8 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|d427d808475caa06025d45007915e780e3c21639.
Updated by pthomas@redhat.com almost 8 years ago
Added a pulp smash issue.
https://github.com/PulpQE/pulp-smash/issues/459
Added by semyers almost 8 years ago
Revision b9fe4fcd | View on GitHub
Revert "As a user, orphan content delete reports how many units were deleted"
This reverts commit d427d808475caa06025d45007915e780e3c21639 on 2.10-dev and 2.11-dev.
This change will not be recorded on master (for 2.12), but this commit will appear on master so our automated merge-forward checks don't fail.
Updated by semyers almost 8 years ago
- Platform Release set to 2.12.0
This story was originally merged to 2.10-dev, but has since been reverted on that branch and 2.11-dev, but is still in place on master. It wlll be included in 2.12 as a new feature.
Added by daviddavis almost 8 years ago
Revision 10bd1cca | View on GitHub
Adding release note for orphan removal feature
Updated by semyers almost 8 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE
Updated by bmbouter over 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.
As a user, orphan content delete reports how many units were deleted
Track the counts of units being deleted when orphan remove all is executed and store the result indexed by content type id on the task.
fixes #1268 https://pulp.plan.io/issues/1268