forest icon indicating copy to clipboard operation
forest copied to clipboard

[GC] Add manual trigger.

Open ruseinov opened this issue 1 year ago • 0 comments

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:

  1. 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).
  2. Then it would be easy to support a channel message that would be able to trigger all three GC steps directly one after another.
  3. 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.

ruseinov avatar Jul 01 '24 07:07 ruseinov