Skip to content

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Aug 24, 2023

This is an automatic backport of pull request #9165 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

…vent

`rabbit_stream_coordinator` is the only authority on a stream queue's
leader PID, so we should only trust that process for notifications of
leader changes.

The call to `update_leader_pid/2` from the `update/2` callback may
trigger the effects of a leader change for the stream queue's state
without interacting with the stream coordinator. This is noticeable on
the Khepri branch where the leader failover test case flakes in cases
where the channel process reads a stale record from the metadata store
with an old leader PID and mistakenly triggers the leader change to the
stale leader PID. Removing this block stops the flake without removing
the leader change mechanism to resend unconfirmed messages: the handler
of the `stream_leader_change` event from the stream coordinator still
triggers leader information changes to the queue's state.

This bug is also possible on main but is not reproducible in practice
because mnesia updates fast enough that we are very unlikely to read a
stale leader PID when looking up the queue record.

(cherry picked from commit ec0ffde)
@michaelklishin michaelklishin added this to the 3.12.4 milestone Aug 24, 2023
@michaelklishin michaelklishin merged commit 60915be into v3.12.x Aug 24, 2023
@michaelklishin michaelklishin deleted the mergify/bp/v3.12.x/pr-9165 branch August 24, 2023 10:51
michaelklishin added a commit that referenced this pull request Aug 24, 2023
rabbit_stream_queue: Only update leader PID on stream_leader_change event (backport #9165) (backport #9172)
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