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

Fix crash caused by receiving #append_entries_reply{success=false} from unknown peer #432

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

sile
Copy link
Contributor

@sile sile commented Apr 23, 2024

Proposed Changes

This PR fixes a ra server process (leader) crash caused by receiving a #append_entries_reply{success=false} message from an unknown peer.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

If the patch in this PR is not applied, the following crash log will be generated by the append_entries_reply_no_success_from_unknown_peer test case.

=== Location: [{ra_server,handle_leader,472},
              {ra_server_SUITE,append_entries_reply_no_success_from_unknown_peer,989},
              {test_server,ts_tc,1794},
              {test_server,run_test_case_eval1,1303},
              {test_server,run_test_case_eval,1235}]
=== === Reason: no match of right hand side value 
                 #{{n1,'ct_ra@localhost'} =>
                       #{status => normal,next_index => 1,match_index => 0,
                         query_index => 0,commit_index_sent => 0}}
  in function  ra_server:handle_leader/2 (src/ra_server.erl, line 472)
  in call from ra_server_SUITE:append_entries_reply_no_success_from_unknown_peer/1 (test/ra_server_SUITE.erl, line 989)
  in call from test_server:ts_tc/3 (test_server.erl, line 1794)
  in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1303)
  in call from test_server:run_test_case_eval/9 (test_server.erl, line 1235)

src/ra_server.erl Outdated Show resolved Hide resolved
src/ra_server.erl Outdated Show resolved Hide resolved
@kjnilsson kjnilsson merged commit baa1b0d into rabbitmq:main Apr 24, 2024
8 of 10 checks passed
@kjnilsson
Copy link
Contributor

thank you @sile !

@kjnilsson kjnilsson added this to the 2.10.0 milestone Apr 24, 2024
@sile sile deleted the fix-reply-from-unknown-node-crash branch April 25, 2024 00:45
@sile
Copy link
Contributor Author

sile commented Apr 25, 2024

👍

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