Project

Profile

Help

Story #1268

As a user, orphan content delete reports how many units were deleted

Added by mmccune@redhat.com about 5 years ago. Updated 6 months ago.

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

100%

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

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"
}

Checklist


Related issues

Related to Pulp - Story #2484: As a pulp 3.0 user, orphan content delete reports how many units were deletedCLOSED - CURRENTRELEASE

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

Associated revisions

Revision d427d808 View on GitHub
Added by daviddavis almost 4 years ago

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

Revision d427d808 View on GitHub
Added by daviddavis almost 4 years ago

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

Revision b9fe4fcd View on GitHub
Added by semyers almost 4 years ago

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.

Revision 10bd1cca View on GitHub
Added by daviddavis almost 4 years ago

Adding release note for orphan removal feature

refs #1268 https://pulp.plan.io/issues/1268

History

#1 Updated by mmccune@redhat.com about 5 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.
*

#3 Updated by jortel@redhat.com about 5 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

#5 Updated by mhrivnak about 4 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)

#6 Updated by mhrivnak about 4 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.

#7 Updated by mhrivnak about 4 years ago

  • Sprint Candidate changed from No to Yes

#8 Updated by mhrivnak about 4 years ago

  • Checklist item Make sure this behavior gets to pulp 3 if implemented in pulp 2 first. added

#9 Updated by bmbouter almost 4 years ago

  • Checklist item update the documentation to fix any existing examples of this tasks response added
  • Checklist item update the orphan API docs to call out this behavior added

I added 2 checklist items

#10 Updated by bmbouter almost 4 years ago

  • Groomed changed from No to Yes

#11 Updated by daviddavis almost 4 years ago

  • Assignee set to daviddavis

#12 Updated by daviddavis almost 4 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.

#13 Updated by daviddavis almost 4 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.

#14 Updated by daviddavis almost 4 years ago

  • Sprint/Milestone set to 31

#15 Updated by daviddavis almost 4 years ago

  • Related to Story #2484: As a pulp 3.0 user, orphan content delete reports how many units were deleted added

#16 Updated by daviddavis almost 4 years ago

  • Checklist item Make sure this behavior gets to pulp 3 if implemented in pulp 2 first. set to Done

Opened a bug to fix this in Pulp 3.0:

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

#17 Updated by daviddavis almost 4 years ago

  • Status changed from ASSIGNED to POST

#18 Updated by daviddavis almost 4 years ago

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

#20 Updated by semyers almost 4 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.

#22 Updated by Ichimonji10 almost 4 years ago

  • Status changed from MODIFIED to 6

#23 Updated by daviddavis almost 4 years ago

  • Checklist item update the documentation to fix any existing examples of this tasks response set to Done
  • Checklist item update the orphan API docs to call out this behavior set to Done

#24 Updated by semyers almost 4 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#26 Updated by bmbouter over 2 years ago

  • Sprint set to Sprint 13

#27 Updated by bmbouter over 2 years ago

  • Sprint/Milestone deleted (31)

#28 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

#29 Updated by bmbouter 6 months 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