Skip to content

ra_server: Ignore #info_reply{} from a node that is not part of cluster #536

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

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

dumbbell
Copy link
Collaborator

@dumbbell dumbbell commented Apr 8, 2025

Why

Between the time a node asks for another node's information and the time it gets the reply, it is possible that this other node leaves the cluster for whatever reason.

This causes a crash of the Ra server that asked the information because it accesses the cluster map to get the state of the node that emitted the #info_reply{} without checking first if the node is still part of the cluster (i.e., there is a key corresponding to that node in the cluster map).

To be exact, line 3651 raises a badkey exception:

PeerState0 = maps:get(PeerId, Cluster),

How

We simply ignore the #info_reply{} from a node that is not present in the cluster map.

…ster

[Why]
Between the time a node asks for another node's information and the time
it gets the reply, it is possible that this other node leaves the
cluster for whatever reason.

This causes a crash of the Ra server that asked the information because
it accesses the `cluster` map to get the state of the node that emitted
the `#info_reply{}` without checking first if the node is still part of
the cluster (i.e., there is a key corresponding to that node in the
`cluster` map).

To be exact, line 3651 raises a `badkey` exception:

    PeerState0 = maps:get(PeerId, Cluster),

[How]
We simply ignore the `#info_reply{}` from a node that is not present in
the `cluster` map.
@dumbbell dumbbell added the bug label Apr 8, 2025
@dumbbell dumbbell requested a review from kjnilsson April 8, 2025 10:00
@dumbbell dumbbell self-assigned this Apr 8, 2025
@dumbbell dumbbell marked this pull request as ready for review April 8, 2025 10:20
@kjnilsson kjnilsson merged commit 302eb2d into main Apr 8, 2025
3 checks passed
dumbbell added a commit to rabbitmq/khepri that referenced this pull request Apr 8, 2025
Release notes:
https://github.com/rabbitmq/ra/releases/tag/v2.16.7

In particular, it contains a bug fix around the handling of
`#info_reply{}` (rabbitmq/ra#536).
dumbbell added a commit to rabbitmq/rabbitmq-server that referenced this pull request Apr 8, 2025
Release notes:
https://github.com/rabbitmq/ra/releases/tag/v2.16.7

What's changed:
* ra_server: Ignore `#info_reply{}` from a node that is not part of
  cluster (rabbitmq/ra#536).
mergify bot pushed a commit to rabbitmq/rabbitmq-server that referenced this pull request Apr 8, 2025
Release notes:
https://github.com/rabbitmq/ra/releases/tag/v2.16.7

What's changed:
* ra_server: Ignore `#info_reply{}` from a node that is not part of
  cluster (rabbitmq/ra#536).

(cherry picked from commit 8dec1ab)
michaelklishin pushed a commit to rabbitmq/rabbitmq-server that referenced this pull request Apr 24, 2025
Release notes:
https://github.com/rabbitmq/ra/releases/tag/v2.16.7

What's changed:
* ra_server: Ignore `#info_reply{}` from a node that is not part of
  cluster (rabbitmq/ra#536).
ikavgo pushed a commit to rabbitmq/rabbitmq-server that referenced this pull request May 5, 2025
Release notes:
https://github.com/rabbitmq/ra/releases/tag/v2.16.7

What's changed:
* ra_server: Ignore `#info_reply{}` from a node that is not part of
  cluster (rabbitmq/ra#536).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants