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

Implements concurrent segmented queues #638

Closed
wants to merge 23 commits into from

Conversation

andsel
Copy link
Collaborator

@andsel andsel commented Jan 3, 2022

Release notes

Introduce new persistent queue implementation based on concurrent access to segmented queues.

What does this PR do?

All queues are saved in segments, each segment in stored in a memory mapped region named page where each page can contains multiple segments of different queues. The access to the segment is based on CAS operator on such named SegmentPointer objects, when the CAS is not possible a retry is repeated until new Segment access is required, in which case the access is managed by a usual lock guarded section

Why is it important/What is the impact to the user?

@hylkevds
Copy link
Collaborator

Is there a way to discard/close a queue? For example when the client reconnects with cleanSession=true?

@andsel
Copy link
Collaborator Author

andsel commented Apr 20, 2022

@hylkevds good to remind it, I haven't yet thought about :-)
I'm working on your suggestion to reuse already consumed segments in pages.
I think that the close/cleanup of a queue it's easy, simply consider the segments that composed the queue as "available for reuse". Whatever is not listed in the checkpoint files is garbage.

… offsets to the respective physical segments, which permits to have not monitically incrementing segments and put the basis for segments reuse and limiting holes (external fragmentation) in page files
@andsel andsel mentioned this pull request Oct 10, 2022
1 task
- one that advanced twice a pointer (newSegmentPointer)
- fixed calculation of availableDataLength in a segment while writing payload across two segments
@andsel
Copy link
Collaborator Author

andsel commented Dec 17, 2022

Superseeded by #691

@andsel andsel closed this Dec 17, 2022
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