Project

Profile

Help

Story #1268

closed

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

Added by mmccune@redhat.com over 8 years ago. Updated almost 4 years 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"
}

Related issues

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

Actions
Actions #1

Updated by mmccune@redhat.com over 8 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.
*

Actions #3

Updated by jortel@redhat.com over 8 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
Actions #5

Updated by mhrivnak over 7 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)
Actions #6

Updated by mhrivnak over 7 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.

Actions #7

Updated by mhrivnak over 7 years ago

  • Sprint Candidate changed from No to Yes
Actions #8

Updated by mhrivnak over 7 years ago

Actions #9

Updated by bmbouter over 7 years ago

I added 2 checklist items

Actions #10

Updated by bmbouter over 7 years ago

  • Groomed changed from No to Yes
Actions #11

Updated by daviddavis over 7 years ago

  • Assignee set to daviddavis
Actions #12

Updated by daviddavis over 7 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.

Actions #13

Updated by daviddavis over 7 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.

Actions #14

Updated by daviddavis over 7 years ago

  • Sprint/Milestone set to 31
Actions #15

Updated by daviddavis over 7 years ago

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

Updated by daviddavis over 7 years ago

Opened a bug to fix this in Pulp 3.0:

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

Actions #17

Updated by daviddavis over 7 years ago

  • Status changed from ASSIGNED to POST

Added by daviddavis over 7 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.

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

Added by daviddavis over 7 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.

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

Actions #18

Updated by daviddavis over 7 years ago

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

Added by semyers over 7 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.

Actions #20

Updated by semyers over 7 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.

Actions #22

Updated by Ichimonji10 over 7 years ago

  • Status changed from MODIFIED to 6
Actions #23

Updated by daviddavis over 7 years ago

Added by daviddavis over 7 years ago

Revision 10bd1cca | View on GitHub

Adding release note for orphan removal feature

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

Actions #24

Updated by semyers about 7 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #26

Updated by bmbouter about 6 years ago

  • Sprint set to Sprint 13
Actions #27

Updated by bmbouter about 6 years ago

  • Sprint/Milestone deleted (31)
Actions #28

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added
Actions #29

Updated by bmbouter almost 4 years ago

  • Category deleted (14)

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

Also available in: Atom PDF