Update Ra from 2.15.0 to 2.16.0#314
Merged
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #314 +/- ##
==========================================
- Coverage 89.48% 89.16% -0.32%
==========================================
Files 22 22
Lines 3290 3295 +5
==========================================
- Hits 2944 2938 -6
- Misses 346 357 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
a79fcc8 to
a7f87a1
Compare
[Why] We are about to update Ra to version 2.16.0 and it requires Erlang/OTP 26. Therefore, Khepri will require the same version as a consequence. Let's make it explicit.
a048047 to
ee36376
Compare
[Why]
With Ra 2.16.0, an inconsistency with return values was fixed and it can
now return `{error, normal}` in the Ra server exits with reason `normal`
while a synchronous call is performed. Before, Ra would throw an
exception with the `{normal, ...}` reason.
[How]
The new return value is treated like `{error, shutdown}`.
This uncovers a small issue with `wait_for_cluster_change_permitted/2`.
This function relies on `wait_for_leader/2`. The retry loop in
`wait_for_leader/2` is fine but for the purpose of
`wait_for_cluster_change_permitted/2`, it waits until timeout if the Ra
server is not running instead of returning immediately. This affects
`do_join_locked/4` which fails as a consequence.
A new option was introduced to stop the retry in `wait_for_leader/2` if
the Ra server is not running. This better suits the need of
`wait_for_cluster_change_permitted/2` and the cluster formation code.
... instead of hard-coding a 200 ms sleep. [Why] The same value is used in other retry loops in the same module. It should have been used there as well.
Release notes: https://github.com/rabbitmq/ra/releases/tag/v2.16.0 One important change is rabbitmq/ra#493: it delays the machine version upgrade until all members are up-to-date. This ensures that a Khepri cluster member doesn't become stuck because it is running an older version compared to the cluster leader. V2: Adapt `cluster_SUITE` to a new behavior in Ra.
7927180 to
99ebba6
Compare
dumbbell
added a commit
that referenced
this pull request
Nov 6, 2025
[Why]
Ra can return `{error, normal}` when a Ra server exits. We already
handle this return value, thanks to pull requests #314 and #335.
However, it can happen in `process_sync_command/3: this was reported
once in CI. Thus it is rare, but still possible.
[How]
Like in previous patches, we treat `{error, normal}` like `{error,
noproc}`.
dumbbell
added a commit
that referenced
this pull request
Nov 6, 2025
[Why]
Ra can return `{error, normal}` when a Ra server exits. We already
handle this return value, thanks to pull requests #314 and #335.
However, it can happen in `process_sync_command/3`: this was reported
once in CI. Thus it is rare, but still possible.
[How]
Like in previous patches, we treat `{error, normal}` like `{error,
noproc}`.
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.
Release notes:
https://github.com/rabbitmq/ra/releases/tag/v2.16.0
One important change is rabbitmq/ra#493: it delays the machine version upgrade until all members are up-to-date. This ensures that a Khepri cluster member doesn't become stuck because it is running an older version compared to the cluster leader.
V2: Adapt
cluster_SUITEto a new behavior in Ra.V3: Require Erlang/OTP 26 because Ra requires it now.
V4: Handle
{error, normal}like{error, shutdown}: instead of emitting a{normal, ...}exit signal, the Ra server returns it as a regular{error, normal}reture value.It also means that
wait_for_leader/2andwait_for_cluster_change_permitted/2can return{error, noproc}. Indo_reset/4, ifwait_for_cluster_change_permitted/2returns{error, noproc}, we keep the same behavior as with the{normal, ...}exit signal.