From 921d84c6c218bf063376687e255d65f9f11e987b Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 23 Feb 2018 23:28:15 -0800 Subject: [PATCH] jobd.pl: improve clone gc scheduling Even a failed top-level clone might need to run gc because of a .needsgc situation. However, in-progress clones should never run gc but the logic wasn't quite right and if the fetch portion had been bypassed they might have. Correct that now. Signed-off-by: Kyle J. McKay --- jobd/jobd.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jobd/jobd.pl b/jobd/jobd.pl index edbea28..7200d90 100755 --- a/jobd/jobd.pl +++ b/jobd/jobd.pl @@ -50,7 +50,9 @@ sub update_project { -e "$projpath/.bypass_fetch" || is_mirror_disabled($p)) { job_skip($job); - return setup_gc($job); + setup_gc($job) unless ! -e "$projpath/.nofetch" && + -e "$projpath/.clone_in_progress" && ! -e "$projpath/.clone_failed"; + return; } if (-e "$projpath/.clone_in_progress" && ! -e "$projpath/.clone_failed") { job_skip($job, "initial mirroring not complete yet"); @@ -58,10 +60,8 @@ sub update_project { } if (-e "$projpath/.clone_failed") { job_skip($job, "initial mirroring failed"); - # Still need to gc non top-level clones even if they've failed - # otherwise the objects copied into them from the parent will - # just accumulate without bound - setup_gc($job) if $p =~ m,/,; + # Still need to gc clones even if they've failed + setup_gc($job); return; } if (my $ts = is_operation_uptodate($p, 'lastrefresh', rand_adjust($Girocco::Config::min_mirror_interval))) { -- 2.11.4.GIT