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
[x] 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.
[x] 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)
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 applyChecklist
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.CONTRIBUTING.md
documentFurther 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.