forest
forest copied to clipboard
[GC] Add manual trigger.
Triggering the GC manually currently has only one pitfall - it might leave the DB in an inconsistent state should there be a fork, which is highly unlikely.
Once the F3 is there - it should be nearly 100% safe.
What needs to change.
In order to be able to run the GC manually we'd need to redesign the current approach and do the following:
- Rewrite the GC to be triggered via messages from a channel as opposed to an infinite loop with timeouts and state transitions. (e.g. a separate process like now that sends the initial GC trigger message and then the GC would be able to send messages to that same channel with further steps, timeouts etc).
- Then it would be easy to support a channel message that would be able to trigger all three GC steps directly one after another.
- An endpoint to manually trigger the GC, that could be optionally enabled and/or protected somehow from the outside world. In an ideal world this is only needed for testing, so there is no need to enable it by default.