gc.sh: do not skip .needsgc because of .delaygc
commit23b0816e094ca10010129665a12c743ba6d2db0b
authorKyle J. McKay <mackyle@gmail.com>
Wed, 20 Dec 2017 10:29:20 +0000 (20 02:29 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 20 Dec 2017 10:29:20 +0000 (20 02:29 -0800)
tree658e17a420a75bdc66d469c71fdc724e34ef2f98
parent0df1370df327fbc3a6e940c251ac5704d6dc5b1f
gc.sh: do not skip .needsgc because of .delaygc

The .delaygc sentinel serves to delay the initial full gc (and
corresponding .bitmap and .bndl creation) until after the project's
initial content has been received (either via an incoming push or
the initial non-empty fetch).

On the other hand, the .needsgc sentinel means something needs to
be done right now for this project regardless of any other content
that may or may not have arrived yet.

Normally, if a project is eligible for a full gc (either because
it's never had one before or min_gc_interval has elapsed), the
.needsgc sentinel is ignored because a full gc accomplishes
everything a "mini" gc would and therefore supersedes it.

However, due to the logic, if the project is eligible for a full
gc, but .delaygc is set then nothing will happen at all because
eligibility for full gc causes .needsgc to be ignored and the
presence of .delaygc causes full gc to be suppressed.

Correct this and make sure that in the unusual case where both
.needsgc and .delaygc are present and the project is eligible
for full gc, that it still does at least a "mini" gc rather than
nothing at all.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
jobd/gc.sh