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

address unmatched_returns in cluster metadata code #511

Merged
merged 1 commit into from
Jan 26, 2014

Conversation

jrwest
Copy link
Contributor

@jrwest jrwest commented Jan 25, 2014

the following dialyzer errors no longer appear with this commit:

hashtree_tree.erl:343:
Expression produces a value of type hashtree:hashtree(), but this value is unmatched

hashtree_tree.erl:360:
Expression produces a value of type hashtree:hashtree(), but this value is unmatched

hashtree_tree.erl:368:
Expression produces a value of type hashtree:hashtree(), but this value is unmatched

hashtree_tree.erl:376:
Expression produces a value of type hashtree_tree:tree(), but this value is unmatched

riak_core_broadcast.erl:301:
Expression produces a value of type [['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:326:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:334:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:338:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:351:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:383:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:452:
Expression produces a value of type ['true'], but this value is unmatched

riak_core_metadata_exchange_fsm.erl:184:
Expression produces a value of type ['ok'], but this value is unmatched

riak_core_metadata_manager.erl:332:
Expression produces a value of type atom() | tid(), but this value is unmatched

riak_core_metadata_manager.erl:337:
Expression produces a value of type {'ok','cluster_meta_manifest'}, but this value is unmatched

riak_core_metadata_manager.erl:402:
Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched

riak_core_metadata_manager.erl:560:
Expression produces a value of type atom() | tid(), but this value is unmatched

riak_core_metadata_manager.erl:599:
Expression produces a value of type atom() | {'error',_} | tid(), but this value is unmatched

Review:

  • verify riak_test cluster_meta_basic still passes (NOTE: there is known, unrelated intermittent failure)
  • verify dialyzer errors above are gone
  • verify there were no missed dialyzer errors in cluster metadata files

A useful grep pattern for review: "\(riak_core_\(broadcast\|metadata\)\|hashtree_tree\)"

the following dialyzer errors no longer appear with this commit:

hashtree_tree.erl:343:
Expression produces a value of type hashtree:hashtree(), but this value is unmatched

hashtree_tree.erl:360:
Expression produces a value of type hashtree:hashtree(), but this value is unmatched

hashtree_tree.erl:368:
Expression produces a value of type hashtree:hashtree(), but this value is unmatched

hashtree_tree.erl:376:
Expression produces a value of type hashtree_tree:tree(), but this value is unmatched

riak_core_broadcast.erl:301:
Expression produces a value of type [['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:326:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:334:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:338:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:351:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:383:
Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched

riak_core_broadcast.erl:452:
Expression produces a value of type ['true'], but this value is unmatched

riak_core_metadata_exchange_fsm.erl:184:
Expression produces a value of type ['ok'], but this value is unmatched

riak_core_metadata_manager.erl:332:
Expression produces a value of type atom() | tid(), but this value is unmatched

riak_core_metadata_manager.erl:337:
Expression produces a value of type {'ok','cluster_meta_manifest'}, but this value is unmatched

riak_core_metadata_manager.erl:402:
Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched

riak_core_metadata_manager.erl:560:
Expression produces a value of type atom() | tid(), but this value is unmatched

riak_core_metadata_manager.erl:599:
Expression produces a value of type atom() | {'error',_} | tid(), but this value is unmatched
@rzezeski
Copy link
Contributor

Verified that said warnings were removed by running dialyzer before
and after and doing diff between runs.

$ diff -u d.txt d2.txt | grep '^-'
-hashtree_tree.erl:343: Expression produces a value of type hashtree:hashtree(), but this value is unmatched
-hashtree_tree.erl:360: Expression produces a value of type hashtree:hashtree(), but this value is unmatched
-hashtree_tree.erl:368: Expression produces a value of type hashtree:hashtree(), but this value is unmatched
-hashtree_tree.erl:376: Expression produces a value of type hashtree_tree:tree(), but this value is unmatched
-riak_core_broadcast.erl:301: Expression produces a value of type [['ok' | [any()]]], but this value is unmatched
-riak_core_broadcast.erl:326: Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched
-riak_core_broadcast.erl:334: Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched
-riak_core_broadcast.erl:338: Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched
-riak_core_broadcast.erl:351: Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched
-riak_core_broadcast.erl:383: Expression produces a value of type 'ok' | ['ok' | ['ok' | [any()]]], but this value is unmatched
-riak_core_broadcast.erl:452: Expression produces a value of type ['true'], but this value is unmatched
-riak_core_metadata_exchange_fsm.erl:184: Expression produces a value of type ['ok'], but this value is unmatched
-riak_core_metadata_manager.erl:332: Expression produces a value of type atom() | tid(), but this value is unmatched
-riak_core_metadata_manager.erl:337: Expression produces a value of type {'ok','cluster_meta_manifest'}, but this value is unmatched
-riak_core_metadata_manager.erl:402: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
-riak_core_metadata_manager.erl:560: Expression produces a value of type atom() | tid(), but this value is unmatched
-riak_core_metadata_manager.erl:599: Expression produces a value of type atom() | {'error',_} | tid(), but this value is unmatched

Verified nothing was missed for cluster meta related modules:

# egrep '(riak_core_(broadcast|metadata)|hashtree_tree)' d2.txt
Compiled src/riak_core_metadata_exchange_fsm.erl
Compiled src/riak_core_metadata_manager.erl
Compiled src/hashtree_tree.erl
Compiled src/riak_core_broadcast.erl

Still trying to run cluster_meta_basic, having issues with goldrush starting or something.

@rzezeski
Copy link
Contributor

Successful run of cluster_meta_basic test. My problem before was bad
test setup.

Test Results:
cluster_meta_basic-bitcask: pass
---------------------------------------------
0 Tests Failed
1 Tests Passed
That's 100.0% for those keeping score

@rzezeski
Copy link
Contributor

+1 to merge.

jrwest added a commit that referenced this pull request Jan 26, 2014
address unmatched_returns in cluster metadata code
@jrwest jrwest merged commit 00a4e19 into develop Jan 26, 2014
@jrwest jrwest modified the milestones: 2.0-beta, 2.0 Mar 24, 2014
@seancribbs seancribbs deleted the bugfix/jrw/dialyzer-cm branch April 1, 2015 23:05
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