-
Notifications
You must be signed in to change notification settings - Fork 392
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 Dialyzer warnings #528
Conversation
{legacy, _} -> | ||
{ignore, legacy}; | ||
{error, invalid_resize_claim} -> | ||
lager:error("invalid_resize_claim BUG"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably doesn't need to log. just surface the error to the user? or does this path not bubble back up that far...need to look...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok we should be able to bubble this up to the user like so (sorry this is going to be a little verbose because im working through it as i type):
maybe_commit_staged/2
where this change has been made is called within ariak_core_ring_manager:ring_trans/2
so instead of logging we can return{ignore, invalid_resize_claim}
on L402. the current implementation is actually an invalid return value for thering_trans/2
call (although the ring manager handles this)- the
{ignore, invalid_resize_claim}
will be transformed to{error, invalid_resize_claim}
here https://github.com/basho/riak_core/blob/bugfix/realtalk/dialyze/src/riak_core_claimant.erl#L389-L390 and this ultimately bubbles up to the caller as the return value ofriak_core_claimant:commit/1
- we will have to add a new case to https://github.com/basho/riak_core/blob/develop/src/riak_core_console.erl#L742-L761 to display the error to the user. something like https://github.com/basho/riak_core/blob/develop/src/riak_core_console.erl#L610-L614
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How's this?
io:format("Unable to commit staged ring changes while ring is resizing.~n"
"Check that there are no pending changes in 'riak-admin ring-status'~n"
"If there are, try again once they are completed,~n"
"Otherwise try again shortly.~n");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the delay:
"Unable to commit staged ring changes while ring is resizing" -> "Unable to commit staged ring changes"
The issue is not that the ring is resizing but that another operation took place (e.g. unstaged join) between the plan and the commit. Not sure how to best explain that, so figure its easier just to be short.
|
Some of these should really cause crashes when errors are returned, since later expressions expect them to have succeeded.
Removed the related dead code.
…don't have to match.
TODO: Ask @jonmeredith @jtuple what this was for
…ported. The case where it returns verbose information is only useful for the test, and should probably instead be tested with EQC.
TODO: This seems like a real bug that should be addressed. Ask @jrwest
Since we expect this to succeed (some other node just asked us to rejoin), logging an error when it doesn't seems most reasonable.
riak_core_handoff_manager.erl:392: The pattern {F, 'dynamic'} can never match the type 'undefined' | {non_neg_integer(),'bytes' | 'objects'}
riak_core_handoff_receiver.erl:25: Callback info about the riak_core_gen_server behaviour is not available
Yep. We definitely discussed removing that since it's covered by r_t. No On Sat, Feb 22, 2014 at 2:03 PM, Sean Cribbs notifications@github.comwrote:
|
@@ -127,12 +127,7 @@ put_tag(Tag) -> | |||
true -> | |||
FTag = iolist_to_binary(Tag), | |||
put(?DTRACE_TAG_KEY, FTag), | |||
case get(?MAGIC) of | |||
dtrace -> | |||
dtrace:put_utag(FTag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change seems to be removing some functionality? put_utag
vs. put_tag
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dtrace
module was from Scott's patch before it was fixed-up/merged into OTP. There is no such module anymore.
@@ -325,8 +325,7 @@ handle_info({'DOWN', Mref, _, _Pid, _Info}, State) -> | |||
|
|||
%% Update our list of active services and ETS table | |||
Services = ordsets:del_element(Id, State#state.services), | |||
S3 = S2#state { services = Services }, | |||
local_update(S3), | |||
S3 = local_update(S2#state { services = Services }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a case here where we can lose the correct state because local_update/1
may return ok
[1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice that broadcast
is called after the case
statement in that function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes. my mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was just looking at the top of the thread, and wanted to note that you can
add -compile(inline_list_funcs). to the top to get the LC optimizations
added to standard lists module calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evanmcc Interesting. Should we be doing that globally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the other argument for LCs even when the return value is not used is clarity/visual noise reduction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. It's something that I'd need to test. Maybe we can enable
it at the start of the next dev cycle so we have a long time to hopefully
run into any issues.
@@ -35,23 +35,24 @@ | |||
-include_lib("eunit/include/eunit.hrl"). | |||
-endif. | |||
|
|||
-type index() :: non_neg_integer(). | |||
-type index() :: chash:index_as_int(). | |||
-type n_val() :: non_neg_integer(). | |||
-type ring() :: riak_core_ring:riak_core_ring(). | |||
-type preflist() :: [{index(), node()}]. | |||
-type preflist2() :: [{{index(), node()}, primary|fallback}]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're probably nearing the point where we should try to stop making new changes, but couldn't help but comment that i really wish this were something like preflist_ann()
or annotated_preflist()
rather than preflist2()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, will fix.
Sean Cribbs
On Feb 27, 2014, at 7:06 PM, Jordan West notifications@github.com wrote:
In src/riak_core_apl.erl:
@@ -35,23 +35,24 @@
-include_lib("eunit/include/eunit.hrl").
-endif.--type index() :: non_neg_integer().
+-type index() :: chash:index_as_int().
-type n_val() :: non_neg_integer().
-type ring() :: riak_core_ring:riak_core_ring().
-type preflist() :: [{index(), node()}].
-type preflist2() :: [{{index(), node()}, primary|fallback}].
we're probably nearing the point where we should try to stop making new changes, but couldn't help but comment that i really wish this were something like preflist_ann() or annotated_preflist() rather than preflist2().—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 00086a7
true; | ||
legacy_ring(_) -> | ||
false. | ||
|
||
%% @doc Upgrade old ring structures to the latest format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be worth adding a comment to upgrade/1
and downgrade/1
as to why the functions do basically nothing. long term it would probably be nice to remove them (as any future upgrade/downgrade may work differently)
seeing some issues running
update 1: same issue with update 2: I think i've isolated the issue to some of the recent legacy gossip removal changes. the errors do not appear when rolling back to a5c2443 |
Closing this in favor of a PR that excludes:
|
Getting a clean slate. Only remaining warnings may be:
Those will disappear if cluster_info is on the code path.