housekeeping: Make `CleanStaleData` configurable
CleanStaleData
is an aggregator of multiple cleanup functions. There is
no way of configuring the required cleanup functions when calling
CleanStaleData
.
To make it config friendly, we introduce CleanStaleDataConfig
which will
be the configuration used by CleanStaleData. CleanStaleData then calls
the specified cleanup functions as mentioned in the config.
Also introduce OnlyStaleReferenceLockCleanup
, which generates a
config which only contains the reference lock cleanup function with a
specified grace period. This is done by making findStaleReferenceLocks
a closure which works on a given grace period.
Part of #4736 (closed)
Edited by Christian Couder