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

Feature/revised/riak cli handoff status 1239 #661

Conversation

JeetKunDoug
Copy link
Contributor

Implement "riak-admin handoff summary" and "riak-admin handoff details [--node=] [--all]"

populate_inbound_types(Inbound, Outbound) ->
[case find_matching_outbound(Transfer, Outbound) of
[] -> Transfer;
[Match | _] ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwing away extra list entries seems potentially suspect to me. If find_matching_outbound should only ever return one item, then we should only match on one item. If not, can we safely ignore extra entries? I'm wondering whether we might potentially end up showing the wrong inbound transfer type here. What if there are multiple outbound transfers that have the same target_node/target_partition/mod, but different types? (Not sure what mod means though, so maybe that rules out differing types?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I did that because I had once seen a literal duplicate in active transfers somewhere, but perhaps I was hallucinating, as I wasn't crazy about it either. I'll try to remove it and do some testing to see what's up, but you really should never have a duplicate active transfer from what I can tell.

@JeetKunDoug JeetKunDoug force-pushed the feature/revised/riak-cli-handoff-status-1239 branch 4 times, most recently from 750c111 to b0c12ae Compare December 10, 2014 21:45
handoff_details([], [{all, _Value}]) ->
build_handoff_details(all);
handoff_details([], _) ->
[riak_cli_status:alert([riak_cli_status:text("Cannot use both --all and --node flags at the same time.")])].

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question for @andrewjstone should there be a way in the flag specs to say that flags x and y are mutually exclusive? Future enhancement for riak_cli perhaps?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep @mrallen1 , I just opened an issue for this: basho/clique#22

@jadeallenx
Copy link

Great work @JeetKunDoug Thanks.

@nickelization
Copy link
Contributor

👍

@JeetKunDoug JeetKunDoug force-pushed the feature/revised/riak-cli-handoff-status-1239 branch 2 times, most recently from 80fec5c to 9e3ff06 Compare December 12, 2014 14:40
addition to riak_core_handoff_status (the main module) the following
changes were made to other modules in support of this functionality.
* Refactored riak_core_vnode_manager:handle_call({repair...}) for readability.
* Refactor riak_core_vnode_manager:determine_handoff_target/4 into a series of function headers
* Create riak_core_vnode_manager:all_handoffs
* Some additional fixes for refactoring of handoff_type/ho_type into
  single cohesive type from 07e32b0
@JeetKunDoug JeetKunDoug force-pushed the feature/revised/riak-cli-handoff-status-1239 branch from 9e3ff06 to b500a0c Compare December 12, 2014 15:02
case transfer_info(Transfer, stats) of
no_stats -> unknown;
Stats ->
{Key, Value} = lists:keyfind(Key, 1, Stats),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this ever return false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it does, it should blow up - the list of stats is hard-coded in riak_core_handoff_manager:calc_stats and is always the same.

* Refactor parse_ring_into_known and explode_ring_modules into simpler list comprehensions.
* Merge riak_cli registrations from handoff_status module to handoff_cli.
@andrewjstone
Copy link
Contributor

👍 8fc16f9

borshop added a commit that referenced this pull request Dec 12, 2014
…tatus-1239

Feature/revised/riak cli handoff status 1239

Reviewed-by: andrewjstone
borshop added a commit that referenced this pull request Dec 12, 2014
…tatus-1239

Feature/revised/riak cli handoff status 1239

Reviewed-by: zeeshanlakhani,aberghage
@JeetKunDoug
Copy link
Contributor Author

@borshop merge

@borshop borshop merged commit b64964e into integration/riak-admin-handoff-team Dec 15, 2014
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.

7 participants