Story #2813

As a user, I can delete already downloaded files for a particular repo(s) in case of on_demand policy

Added by ttereshc about 3 years ago. Updated 6 months ago.

Start date:
Due date:
% Done:


Estimated time:
Platform Release:
Sprint Candidate:
Pulp 2


There is a desire to be able to reduce disk space by deleting files of the units associated with a particular repository (or a set of repositories) if files aren't actually needed. Those files can be downloaded again at the next request.

Several points to take into consideration:

  1. File(s) of a content unit shouldn't be deleted if there is at least one repository with immediate policy which the content unit is associated with.
  2. Content unit should be marked back as non-downloaded one. Mark as it is not downloaded first and only then actually delete files to avoid the race condition when unit is marked as downloaded but files are no longer on a disk.
  3. Since only one copy of the file(s) for a particular content unit is stored on a disk, they will be deleted for all the repositories which the content unit is associated with.
  4. Even if a resource reservation is used for a repo of interest, multiple repos may be affected (see previous point ^). This may lead to a race condition:
    - between this deletion task and a sync of the other repo which just switched from on_demand to immediate policy for In this case at least one unit may be deleted for a repo with immediate policy when it should not be.
    - between this deletion task and periodical download_deferred task which downloads recently requested files.
    - more?
  5. A greedy use case to consider: delete all files for all on_demand repositories in Pulp.


#1 Updated by pcreech about 3 years ago

  • Groomed changed from No to Yes

#2 Updated by bmbouter about 3 years ago

There is still a separate race condition for a single repo. Maybe this is one of the race conditions described in the ticket, but those seemed to focus on multi-repo race conditions.

1. The user says to delete the content in a specific repo, say foo
2. The unit abc is marked as non-downloaded one
3. A client machine requests unit abc which causes the download to be marked as downloaded again <----- this is the race part
4. Unit abc's files are deleted

This would leave the unit abc in the 'downloaded' state, yet it's deleted from disk.

I think before starting this story the race conditions need to be written out more fully. They are kind of written out, but kind of vague. Also, how will these race conditions be solved? I believe planning how to address each race condition ahead of time would be better than hoping the implementer addresses all race conditions perfectly.

#5 Updated by bmbouter about 1 year ago

  • Tags Pulp 2 added

#6 Updated by ttereshc 6 months ago

  • Status changed from NEW to CLOSED - WONTFIX

Pulp 2 is in maintenance mode. This feature won't be implemented for Pulp 2.
The same request for Pulp 3 is tracked by #5926.

Please register to edit this issue

Also available in: Atom PDF