]
Barak Korren updated OVIRT-1005:
--------------------------------
Epic Link: OVIRT-400
Fix race condition caused by experimental cleanup script
--------------------------------------------------------
Key: OVIRT-1005
URL:
https://ovirt-jira.atlassian.net/browse/OVIRT-1005
Project: oVirt - virtualization made easy
Issue Type: Improvement
Reporter: Barak Korren
Assignee: infra
Priority: Highest
The experimental repo has a cleanup script that is ran every hour via cron. The script is
meant to delete old and unused package builds.
The content of the script is as follows:
{code}
find \
/srv/resources/repos/ovirt/experimental/*/* \
-maxdepth 0 \
-type d \
-not -name 'latest.*' \
-and \
-mtime +1 \
-exec rm -rf {} \;
{code}
The problem here is that 'latest' is not filtered out to not be deleted by this
script. It is OK to delete it in most cases because then it gets recreated by the
'deploy-to-experimental' job, but there might be a case where
'test-repo_ovirt-experimental_*' can run before this happens, this may cause it to
get an empty or partial 'latest' repo.
To remedy this, the script needs to be changed to be the following:
{code}
find \
/srv/resources/repos/ovirt/experimental/*/* \
-maxdepth 0 \
-type d \
-not -name 'latest.*' \
-and \
-not -name 'latest' \
-and \
-mtime +1 \
-exec rm -rf {} \;
{code}
The script itself on the resources server was already changed in-palce, this ticket is so
we this change is also "backed up" to the 'infra-puppet' repo.