Previously GC, even with the session-aware safepoint controller, such as is used with Auto GC, would cancel any ongoing stats work and would restart it at the end of the run. Because Auto GC can run quite frequently and because stats can take a while to run to completion, this meant that on some workloads stats would never successfully populate.
This PR changes stats so that it more correctly integrates with the session-safe GC safepoint controller. That allows GC to ensure that the stuff stats is currently working on gets carried over to the collected view of database, and stats itself has a chance to run to completion regardless of what GC work is going on.
This PR leaves the cancel-stats-on-collect behavior enabled for the kill-connections safepoint controller, where that behavior is still the correct one.
Fixes: #483
Local/remote refs take priority in Do What I Mean (DWIM) scenarios where dolt has to interpret ambiguous input in checkout.
If a table and tracking branch share the same name, but local does not exist an error will occur.
-- can now be used to clear up ambiguity.
case 1: dolt checkout <ref> -- [<tables>]
<ref> must be a singular valid tree, everything else after '--' must be a table.
case 2: dolt checkout -- [<tables>]
This is case 1 but without <ref>.
case 3: git checkout <something> [--]
(a) If is a commit switch to branch.
(b) If isn’t a commit, and either "--" is present or isn’t a table, no -t or -b is given, and there’s a tracking branch named on exactly one remote (or on the specified remote), then this acts as shorthand to fork local from that remote-tracking branch.
(c) Otherwise, if "--" is present, treat it like case 1.
(d) Otherwise, if a ref treat it like case 1. If a table treat like case 2. If neither fail.
case 4: git checkout <something> <tables>
The first argument must not be ambiguous. If a <ref> follow case 1, if a table follow case 2. Otherwise, fail.