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

Do not crash when object's contents is an empty list #1837

Conversation

efcasado
Copy link
Contributor

@efcasado efcasado commented Nov 19, 2022

Description

It is related to this known issue.

The issue, however, is that this case clause, which was introduced to be able to debug the issue, is never executed because riak_object:is_head/1 called in the case statement crashes due to the object's content being an empty list.

[error] <0.10284.7>@riak_core_vnode:vnode_command:376 riak_kv_vnode command failed {function_clause,[{lists,nth,[1,[]],[{file,"lists.erl"},{line,170}]},{riak_object,is_head,1,[{file,"/root/riak/rel/pkg/out/BUILD/riak-3.0.10-OTP22.3/_build/default/lib/riak_kv/src/riak_object.erl"},{line,352}]},{riak_kv_vnode,enforce_allow_mult,3,[{file,"/root/riak/rel/pkg/out/BUILD/riak-3.0.10-OTP22.3/_build/default/lib/riak_kv/src/riak_kv_vnode.erl"},{line,3123}]},{riak_kv_vnode,prepare_put_existing_object,6,[{file,"/root/riak/rel/pkg/out/BUILD/riak-3.0.10-OTP22.3/_build/default/lib/riak_kv/src/riak_kv_vnode.erl"},{line,2875}]},{riak_kv_vnode,do_put,7,[{file,"/root/riak/rel/pkg/out/BUILD/riak-3.0.10-OTP22.3/_build/default/lib/riak_kv/src/riak_kv_vnode.erl"},{line,2716}]},{riak_kv_vnode,handle_request,4,[{file,"/root/riak/rel/pkg/out/BUILD/riak-3.0.10-OTP22.3/_build/default/lib/riak_kv/src/riak_kv_vnode.erl"},{line,1489}]},{riak_core_vnode,vnode_command,3,[{file,"/root/riak/rel/pkg/out/BUILD/riak-3.0.10-OTP22.3/_build/default/lib/riak_core/src/riak_core_vnode.erl"},{line,373}]},{gen_fsm,handle_msg,8,[{file,"gen_fsm.erl"},{line,497}]}]}

@efcasado efcasado changed the title [WIP] Fix issue that crashes vnode worker when object contents is empty Do not crash when object's contents is an empty list Nov 19, 2022
@efcasado efcasado force-pushed the efcasado-riak_object-is_head-function_clause-error branch from c3c3d50 to 12c91a5 Compare November 19, 2022 19:01
@martinsumner
Copy link
Contributor

Good spot, and thank-you for the contribution. I'm hoping to make a 3.0.12 release (including this fix) available in the next ten days.

@martinsumner martinsumner merged commit 9ca7184 into basho:develop-3.0 Nov 23, 2022
martinsumner pushed a commit that referenced this pull request Dec 19, 2022
* Add test to illustrate issue

* Do not crash when object's contents is an empty list
martinsumner added a commit that referenced this pull request Dec 19, 2022
* Do not crash when object's contents is an empty list (#1837)

* Add test to illustrate issue

* Do not crash when object's contents is an empty list

* add missing function clause repair_keys_range in convert_fold (#1839)

* add missing function clause repair_keys_range in convert_fold, to unbreak aae_fold for that case

* thread converted aae_fold query in riak_client, to complete prev commit

* Change the default PR value from 0 to default (#1836)

This means that get requests will use bucket-type level Primary Read settings

Co-authored-by: Peter Tihanyi <peter.tihanyi@otpbank.hu>

* Mas i1121 reip3 (#1838)

* Add reip/3

To allow for reip without loading the riak_core application

* Use alternate name

* Update riak_kv_console.erl

* Update riak_kv_console.erl

* reip_manual inputs are atoms

* Add warning to update riak.conf file after reip

* Make clear where attention is required

And return 'ok' to make clear the op was successful

* Update rebar.config

* Update log (#1840)

Make situation clearer in log

Rather than change behaviour, just make it clear that the warning can be ignored when shutting down.  This should avoid unnecessary concern.

* Update Readme, remove mercurial refs

Co-authored-by: Enrique Fernández <efcasado@gmail.com>
Co-authored-by: Andrei Zavada <johnhommer@gmail.com>
Co-authored-by: Peter Tihanyi <tihi@systream.hu>
Co-authored-by: Peter Tihanyi <peter.tihanyi@otpbank.hu>
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.

None yet

2 participants