bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

[feat] Support cancel GC

Open nodece opened this issue 8 months ago • 0 comments

FEATURE REQUEST

  1. Please describe the feature you are requesting.

Currently, BookKeeper's internal garbage collection (GC) processes (e.g., ledger GC, entry log compaction) run periodically and can also be manually triggered. However, there is no way to cancel an ongoing GC task once it has started.

This can cause issues such as:

  • Duplicate GC execution when a manual trigger overlaps with the scheduled one.
  • Unnecessary resource consumption (disk I/O, CPU load).
  • Potential delays in normal Bookie operations during heavy GC activity.

Feature request: Introduce the ability to cancel an ongoing GC operation safely, either through administrative APIs or internal control mechanisms, to improve system responsiveness and avoid redundant workloads.

  1. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?

should-have.

Currently, there is no clean workaround. We must wait for the GC to complete naturally, even if it was accidentally triggered or is no longer necessary.

  1. Provide any additional detail on your proposed use case for this feature.
  • During maintenance or operational automation, users might want to abort a GC process that was manually triggered by mistake.
  • In high-load situations, the ability to cancel GC could help prioritize critical Bookie operations instead of resource-intensive background tasks.
  • Adding a GC cancelation mechanism would also allow smarter management strategies, such as conditional GC based on runtime load.

The implementation could be similar to:

  • Setting a cancellation flag checked periodically within the GC execution loop.
  • Exposing an admin command or API endpoint like cancelGC.

nodece avatar Apr 28 '25 09:04 nodece