Project

Profile

Help

Story #8368

closed

Limit number of old repository versions.

Added by newswangerd about 3 years ago. Updated almost 3 years ago.

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

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
GalaxyNG
Sprint:
Quarter:

Description

As an application maintainer, I would like to be able to specify how many old versions of a repository to keep in order to keep the size of my database from growing out of control.

I would like to be able to:

  • specify a default number of repo versions to keep for a specific repository type.
    • ex: allow me to keep that last 200 versions for all AnsibleRepository types and keep all versions for all ContainerRepository types
  • override the default number of repo versions to keep on a repo by repo basis.
    • ex: allow me to specify that repo staging should keep all versions and repo rejected should keep the last 5 repo versions

Related issues

Related to Pulp - Issue #8793: Retained_versions doesn't properly keep all content present in repositoryCLOSED - CURRENTRELEASEdaviddavisActions
Blocked by Pulp - Story #8454: As a user, I can't delete RepositoryVersion.number==0CLOSED - CURRENTRELEASEdaviddavis

Actions
Actions #1

Updated by mdellweg about 3 years ago

I hear, there cold be a int-field on repository to specify the number of retained versions. And the context manager that creates versions could clean up in its __exit__ method.

The question i see if there would be a way to mark precious versions that should not be deleted. What do we do with versions that are linked to a publication / distribution?

Actions #2

Updated by ttereshc about 3 years ago

  • Tracker changed from Issue to Story
  • % Done set to 0
  • Severity deleted (2. Medium)
  • Triaged deleted (No)
Actions #3

Updated by daviddavis about 3 years ago

Will updating the setting/field automatically clean up repo versions? Like if I set the value to 3 and I have 5 versions, does that automatically delete 2 versions?

Actions #4

Updated by bmbouter about 3 years ago

  • Tags GalaxyNG added

daviddavis wrote:

Will updating the setting/field automatically clean up repo versions? Like if I set the value to 3 and I have 5 versions, does that automatically delete 2 versions?

My take was no, but it's important we figure out what we want in the long term because it affects if we have to use the tasking system or not for any change to this. The openapi schema already reports that tasking isn't used, so I'm thinking that maybe we can't have some repsonses return 200 and others returned 202? I'm not clear on if that's a problem for openapi or not. Do you know?

Actions #5

Updated by daviddavis about 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to daviddavis
Actions #6

Updated by pulpbot about 3 years ago

  • Status changed from ASSIGNED to POST
Actions #7

Updated by daviddavis about 3 years ago

bmbouter wrote:

My take was no, but it's important we figure out what we want in the long term because it affects if we have to use the tasking system or not for any change to this. The openapi schema already reports that tasking isn't used, so I'm thinking that maybe we can't have some repsonses return 200 and others returned 202? I'm not clear on if that's a problem for openapi or not. Do you know?

Sorry, I only saw this comment after I opened my PR. The calls to update repository are in fact async:

https://docs.pulpproject.org/pulp_file/restapi.html#operation/repositories_file_file_update

https://docs.pulpproject.org/pulp_file/restapi.html#operation/repositories_file_file_partial_update

I don't know if that makes an argument for supporting cleanup during update but I don't have a huge preference around whether we cleanup versions.

Actions #8

Updated by daviddavis about 3 years ago

  • Blocked by Story #8454: As a user, I can't delete RepositoryVersion.number==0 added
Actions #9

Updated by bmbouter about 3 years ago

  • Sprint/Milestone set to 3.12.0
Actions #10

Updated by mdellweg about 3 years ago

  • Sprint/Milestone changed from 3.12.0 to 3.13.0

Added by daviddavis almost 3 years ago

Revision 0779b5d1 | View on GitHub

Limit how many repo versions Pulp retains

fixes #8368

Actions #11

Updated by daviddavis almost 3 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #12

Updated by daviddavis almost 3 years ago

  • Related to Issue #8793: Retained_versions doesn't properly keep all content present in repository added
Actions #13

Updated by pulpbot almost 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #14

Updated by ipanova@redhat.com almost 3 years ago

  • Sprint/Milestone changed from 3.13.0 to Content/disk space management
Actions #15

Updated by ipanova@redhat.com almost 3 years ago

  • Sprint/Milestone changed from Content/disk space management to 3.13.0

Also available in: Atom PDF