Project

General

Profile

Actions

action #59103

closed

Remove CURRENT repositories that are older than a month

Added by coolo over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
Start date:
2019-11-05
Due date:
% Done:

0%

Estimated time:

Description

limit_assets ignores CURRENT links, but we shouldn't leave them old. If they are no longer current (if we stop syncing the project), limit_assets should remove it as well.


Related issues 2 (0 open2 closed)

Related to openQA Project - action #59008: 900GB of assets not tracked ('other' assets?)Resolvedlivdywan2019-11-04

Actions
Related to openQA Project - action #59888: Take directory mtime of assets into accountResolvedlivdywan2019-11-15

Actions
Actions #1

Updated by livdywan over 4 years ago

  • Related to action #59008: 900GB of assets not tracked ('other' assets?) added
Actions #2

Updated by livdywan over 4 years ago

  • Status changed from New to In Progress
  • Assignee set to livdywan
  • Target version changed from Ready to Current Sprint
Actions #3

Updated by andriinikitin over 4 years ago

Sorry I had to mention that I did remove these files few days ago with commands below (reviewing the list in between):

find /var/lib/openqa/share/factory/repo/ -maxdepth 1 -name "*CURRENT*" -type d -mtime +30 -exec ls -d {}/ \; >> list.txt
( set -x; while read in; do rm -r "$in"; sleep 2; done < list.txt )

It did free up ~70G. The list can be found at /home/anikitin/list.txt on osd.

But the ticket may still need to create a cron job which will do remove outdated folders daily.

Actions #4

Updated by coolo over 4 years ago

as long as we have special case for CURRENT in the code, we can extend it. In the latest PR, Christian removed the special case, but it's unclear what his suggested replacement is. So in doubt we need said systemd timer (forget about cron :)

Actions #5

Updated by livdywan over 4 years ago

coolo wrote:

as long as we have special case for CURRENT in the code, we can extend it. In the latest PR, Christian removed the special case, but it's unclear what his suggested replacement is. So in doubt we need said systemd timer (forget about cron :)

Right. I removed the special case of never ever deleting things with CURRENT in the name. Instead CURRENT repos would be deleted every 14 days like all other assets.

My idea was to also look into a configurable limit like we have for the audit log, e.g having something like this:

[assets/storage_duration]
# Retain CURRENT repos for a month
CURRENT = 30

The keys here would be regular expressions based on the basename, given a time in days, overriding the default for untracked assets.

We could also add things here which we want gone asap or never, if it's useful.

Actions #6

Updated by coolo over 4 years ago

CURRENT repos would be deleted every 14 days like all other assets.

Where do you take that from? untracked assets are deleted X days after their creation time (where X is 2 for osd) - and it would mean we need to resync CURRENT every 2nd day. So extending this X for specific regexps might be a step, but you also need to take the mtime of the repo into account.

Actions #7

Updated by coolo over 4 years ago

... and you will end in a very overengineed setup to save 5 lines of code.

Actions #8

Updated by livdywan over 4 years ago

coolo wrote:

CURRENT repos would be deleted every 14 days like all other assets.

Where do you take that from? untracked assets are deleted X days after their creation time (where X is 2 for osd) - and it would mean we need to resync CURRENT every 2nd day. So extending this X for specific regexps might be a step, but you also need to take the mtime of the repo into account.

Sorry, "every 14 days" is the default. Scratch the number from that sentence.

... and you will end in a very overengineed setup to save 5 lines of code.

Right now those lines ensure that the repos are never cleared. So I had to remove them anyway. Might as well add 5 lines to the correct class which can be configured.

Actions #9

Updated by livdywan over 4 years ago

  • Related to action #59888: Take directory mtime of assets into account added
Actions #10

Updated by okurz over 4 years ago

  • Status changed from In Progress to Resolved

Checking osd:/var/lib/openqa/share/factory/repo I can see that there are "CURRENT" repos but they are not old so this seems to work. https://openqa.suse.de/admin/assets shows "CURRENT" tracked as well as assets in "other/".

Actions

Also available in: Atom PDF