rabbitmq / ra

A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
Other
813 stars 96 forks source link

Fix stale consistent read result after server restart #342

Closed kjnilsson closed 1 year ago

kjnilsson commented 1 year ago

Reset cluster_change_permitted when becoming leader

As if there had been a leader change before this could reset to true even before the leader has fully applied it's noop command for the new term. This could result in occasional stale consistent read results.

kjnilsson commented 1 year ago

I ran the consistent_query_after_restart test in a loop for 20 minutes without failures. Before the fix I could get it to fail every 5 runs or so.