Skip to content

Quorum queues Raft machine: preserve order for missing deliveries (get_checked_out) #14386

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ikavgo
Copy link
Contributor

@ikavgo ikavgo commented Aug 14, 2025

When I publish some messages, then call checkout in the another client and get {delivery} Effect, consumer client goes into missing messages and the command doesn't keep the order.

So the test:

publish m1
publish m2
publish m3
checkout
publish m4

Before I got:
m3, m2, m1, m4

And now I get:
m1, m2, m3, m4.

@michaelklishin michaelklishin changed the title Preserve order for missing deliveries (get_checked_out) Quorum queues Raft machine: preserve order for missing deliveries (get_checked_out) Aug 14, 2025
@@ -1091,7 +1091,7 @@ handle_aux(_, _, {get_checked_out, ConsumerKey, MsgIds}, Aux0, RaAux0) ->
{S, Acc}
end
end, {RaAux0, []}, maps:with(MsgIds, Checked)),
{reply, {ok, IdMsgs}, Aux0, RaState};
{reply, {ok, lists:reverse(IdMsgs)}, Aux0, RaState};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it needs to be lists:sort/1 instead of lists:reverse, we can't make any assumptions about the maps ordering

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