Skip to content
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

Drop overflow in loop for stream_queue to make sure max-age is respected #608

Merged
merged 3 commits into from
Dec 11, 2023

Conversation

viktorerlingsson
Copy link
Member

@viktorerlingsson viktorerlingsson commented Dec 7, 2023

WHAT is this pull request doing?

Replaces unmap_unused_segments_loop with unmap_and_remove_segments_loop. The new function also removes segments from stream queues where all messages are past max-age.

HOW can this pull request be tested?

Create a stream queue with max-age (ex. 60s).
Publish more messages than fits in one segment file.
Wait the max-age to pass and for the loop to run.
Check that the older segment file has been deleted.

… sure segments with old messages are removed
src/lavinmq/queue/stream_queue.cr Outdated Show resolved Hide resolved
Co-authored-by: Carl Hörberg <carl@84codes.com>
@viktorerlingsson viktorerlingsson marked this pull request as ready for review December 8, 2023 09:20
@viktorerlingsson viktorerlingsson merged commit d8553d4 into main Dec 11, 2023
15 of 20 checks passed
@viktorerlingsson viktorerlingsson deleted the remove_stream_segments_background branch December 11, 2023 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants