box: fix crash while nil-uuid subscribe request#11593
Merged
sergepetrenko merged 1 commit intotarantool:masterfrom Jul 4, 2025
Merged
Conversation
1cf33da to
fc34de4
Compare
AArdeev
approved these changes
Jun 23, 2025
changelogs/unreleased/gh-11531-crash-in-anon-subscribe-request-with-nil-id.md
Outdated
Show resolved
Hide resolved
sergepetrenko
requested changes
Jun 24, 2025
Collaborator
sergepetrenko
left a comment
There was a problem hiding this comment.
Thanks for the fix!
Please find my comments below.
test/box-luatest/gh_11531_crash_in_anonymous_subscribe_request_test.lua
Outdated
Show resolved
Hide resolved
test/box-luatest/gh_11531_crash_in_anonymous_subscribe_request_test.lua
Outdated
Show resolved
Hide resolved
test/box-luatest/gh_11531_crash_in_anonymous_subscribe_request_test.lua
Outdated
Show resolved
Hide resolved
test/box-luatest/gh_11531_crash_in_anonymous_subscribe_request_test.lua
Outdated
Show resolved
Hide resolved
f7f68fc to
5e8423c
Compare
Serpentian
approved these changes
Jul 2, 2025
Contributor
Serpentian
left a comment
There was a problem hiding this comment.
That's a good patch! I don't see any problems
sergepetrenko
requested changes
Jul 2, 2025
Collaborator
sergepetrenko
left a comment
There was a problem hiding this comment.
Thanks for the fixes!
Let's fix the persistent_gc_anon_test and we'll be good to go.
Before this patch a master node could crash when it processed an anonymous iproto subscribe request which had a nil instance uuid. The reason of this error is that in `box_connect_replica` we didn't throw an error when non-exist replica tried to connect to node. It led to a situation when the nullified replica object was tried to dereferenced while iproto subscribe request. Now, we raise an ER_NIL_UUID error if we get an iproto request with nil `instance_uuid`. After this change `test_fetch_snapshot_no_uuid` and `test_checkpoint_join` start fail. The reason of these failures is an incorrect err.type and err.msg of iproto response when we try to send an iproto request with nil `instance_uuid`. Now, these tests are fixed by changing an err.type and err.msg to appropriate values. Also we change `gh_10155_make_iproto_resistant_to_misusage` test because `write_fetch_snapshot` wasn't be able to send iproto fetch_snapshot request with uuid. It led to situation when ER_NIL_UUID error was raised during fetch_snapshot and as a result we weren't be able to read snapshot after this. It broke `test_iproto_crash_fetch_snapshot_subscribe` and `test_iproto_crash_fetch_snapshot_subscribe_not_anon`. Closes tarantool#11531 NO_DOC=bugfix
5e8423c to
1545807
Compare
sergepetrenko
approved these changes
Jul 3, 2025
Collaborator
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release/3.2
git worktree add -d .worktree/backport/release/3.2/11593 origin/release/3.2
cd .worktree/backport/release/3.2/11593
git switch --create backport/release/3.2/11593
git cherry-pick -x 0ba7505b9672ce32067e24fd7a0d31e022b1ef34 |
Collaborator
|
Successfully created backport PR for |
Collaborator
|
Successfully created backport PR for |
Collaborator
Backport summary
|
This was referenced Jul 21, 2025
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.
Before this patch a master node could crash when it processed an
anonymous iproto subscribe request which had a nil instance uuid.
The reason of this error is that in
box_connect_replicawe didn'tthrow an error when non-exist replica tried to connect to node. It
led to a situation when the nullified replica object was tried to
dereferenced while iproto subscribe request. Now, we raise an
ER_NIL_UUID error if we get an iproto request with nil
instance_uuid.After this change
test_fetch_snapshot_no_uuidandtest_checkpoint_joinstart fail. The reason of these failures is anincorrect err.type and err.msg of iproto response when we try to send
an iproto request with nil
instance_uuid. Now, these tests are fixedby changing an err.type and err.msg to appropriate values.
Also we change
gh_10155_make_iproto_resistant_to_misusagetest becausewrite_fetch_snapshotwasn't be able to send iproto fetch_snapshotrequest with uuid. It led to situation when ER_NIL_UUID error was raised
during fetch_snapshot and as a result we weren't be able to read
snapshot after this. It broke
test_iproto_crash_fetch_snapshot_subscribeandtest_iproto_crash_fetch_snapshot_subscribe_not_anon.Closes #11531