Skip to content

rabbitmq-queues, HTTP API: consider providing a way to force a QQ to take a checkpoint #13137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
michaelklishin opened this issue Jan 23, 2025 · 3 comments

Comments

@michaelklishin
Copy link
Collaborator

michaelklishin commented Jan 23, 2025

Is your feature request related to a problem? Please describe.

Due to how quorum queue reclaims its disk space — by deleting segment files that have no live [1] when certain client-driven events happen — a QQ can accumulate a decent disk space footprint.
Under continuous operations where consumers and thus the QQ make progress, this only requires a certain amount of (overprovisioned) disk space.

However, when publishers, consumers and the queue itself go completely quiet after a period of very
high activity with large messages, the segment file truncation won't happen. This scenario is common
for data processing pipelines where activity can be intense but intermittent.

Describe the solution you'd like

For such scenarios, there are two ways to quickly reclaim disk space:

  1. Purge the queue (if it's empty)
  2. Force a checkpoint using ra:cast_aux_command(ServerId, force_checkpoint).

Perhaps the 2nd option could be wrapper in a CLI command. Assuming we do not find an "automatic" way for QQs to do this, which is a lot less obvious because detecting a period of inactivity is prone to false positives.

  1. Ready for delivery or delivered and pending consumer acknowledgement
@aaron-seo
Copy link
Contributor

This is something that we'd be interested in and have discussed in the past as well. I have a rough working implementation: the idea is to write wrapper functions over ra:cast_aux_command(ServerId, force_checkpoint) in the rabbit_quorum_queues module and that should be make it easy to cleanly wrap it again in a CLI command, which seems to be a common pattern so far.

If someone has a good heuristic for an "automatic" way, it could also be reused for that.

@michaelklishin
Copy link
Collaborator Author

@aaron-seo yes, that's roughly what I have in mind.

@michaelklishin
Copy link
Collaborator Author

This is not a support forum. Use discussions for questions.

There are now three different proposed changes to make QQs remove segment files more actively.

Using a stream is a solid alternative before any of them ship.

@rabbitmq rabbitmq locked and limited conversation to collaborators Mar 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants