rabbit_stream_coordinator: Make new_stream command idempotent#15706
Draft
the-mikedavis wants to merge 1 commit intomainfrom
Draft
rabbit_stream_coordinator: Make new_stream command idempotent#15706the-mikedavis wants to merge 1 commit intomainfrom
the-mikedavis wants to merge 1 commit intomainfrom
Conversation
Collaborator
Author
|
I don't think this needs a new machine version since it only affects the reply effects. We could base it on #15695 to take advantage of version 7 though. |
Contributor
|
LGTM. We can indeed wait for #15695 to be merged and use the v7+ macro in a guard on the new filter_command clause. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is similar to #14884 but for
new_stream.Although its unlikely from the calling code, the stream coordinator can end up with two
{new_stream, StreamId, #{}}commands in its log for the sameStreamId. When handling the secondnew_streamit will then warning-log that the stream can't be updated, like so:update_stream0/3only has a function clause for when there is no stream (i.e. undefined,rabbitmq-server/deps/rabbit/src/rabbit_stream_coordinator.erl
Lines 1397 to 1420 in 0b951b8
I haven't been able to reproduce the scenario where this happened. Next time I will dump Khepri and the coordinator's logs to see what sequence of commands lead to this.