Skip to content
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

[v22.3.x] Validate raft response node #10638

Merged
merged 3 commits into from
May 10, 2023

Conversation

bharathv
Copy link
Contributor

@bharathv bharathv commented May 9, 2023

When receiving a reply from a follower leader should always validate if
a follower responding the request is the one that was targeted.
Otherwise a reply should be discarded. Added that missing validation to
all critical raft replies i.e. vote and install_snapshot.

Backport of #9254
Fixes #10526

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.1.x
  • v22.3.x
  • v22.2.x

Release Notes

  • none

Added node_id information to install snapshot and vote replies. The
`node_id` will allow leader to verify if a reply is originating from the
node that the request was sent to.

New will isn't going to be serialized in the old ADL format.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 3612e27)
(cherry picked from commit b74f3c7)
If a node receiving a request have different id than the leader
addresses we must discard the reply. Added validation of a reply node_id
against the id of a node that the request was sent to.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 63aa826)
When receiving a reply from a follower leader should always validate if
a follower responding the request is the one that was targeted.
Otherwise a reply should be discarded. Added that missing validation to
all critical raft replies i.e. vote and install_snapshot.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 0d8848e)
Comment on lines +423 to +424
struct vote_reply
: serde::envelope<vote_reply, serde::version<1>, serde::compat_version<0>> {
Copy link
Contributor Author

@bharathv bharathv May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflict was with compat_version being explicit in the newer branches

@vshtokman vshtokman added this to the v22.3.18 milestone May 10, 2023
@vshtokman vshtokman self-requested a review May 10, 2023 21:20
@vshtokman vshtokman merged commit 7daefea into redpanda-data:v22.3.x May 10, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants