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

add wm code for getting active preflist #1083

Merged
merged 1 commit into from
Feb 27, 2015

Conversation

zeeshanlakhani
Copy link
Contributor

Note: Bors will fail until basho/riak_pb#105 and basho/riak_api#79 is reviewed/merged.

Update for webmachine/pb interface.

Description

Part of RIAK-1481.

The active preflist will return primary/fallback partitions and nodes for the available nodes at the time of query. Primary/fallback will be annotated.
This involves updates to our RiakKV WB code, RiakPB, Riak-Erlang-Http-Client, Riak-Erlang-Client.

*The impetus for adding this to the API started with a mailing list question answered by Charlie Voiselle, http://lists.basho.com/pipermail/riak-users_lists.basho.com/2015-January/016527.html, which involved a snippet of code that we've given clients multiple times. This was then discussed with Russell Brown on HipChat, https://basho.hipchat.com/history/room/867200/2015/01/13?q=enterprising&t=rid-867200#12:23:22.

Other PRs in the series:

]).

-record(ctx, {
api_version :: integer(), %% version of the API to use.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure copying this state record wholesale is necessary. E.g., you don't need:

  1. api_version (always 3 or whatever, this is a new api)
  2. client (you're only getting bucket props)
  3. prefix (again related to ancient API)
  4. riak (this is just legacy cruft, we only "connect" locally)
  5. method (are you supporting anything other than GET/HEAD?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was gonna ask. Will update.

@zeeshanlakhani zeeshanlakhani force-pushed the feature/zl/add-wm-code-for-getting-active-preflist branch 3 times, most recently from 9c289ad to 006d7bb Compare February 25, 2015 22:51
@@ -186,8 +188,17 @@ check_bucket_type(Type) ->
error
end.

-spec maybe_create_bucket_type(binary(), binary()) -> binary() | {binary(), binary()}.
-spec maybe_create_bucket_type(binary(), binary()) -> riak_core_bucket:bucket().
Copy link
Contributor

Choose a reason for hiding this comment

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

This spec looks clearly violated if one can pass undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, yeah, odd. fixing and will rerun.

@zeeshanlakhani zeeshanlakhani force-pushed the feature/zl/add-wm-code-for-getting-active-preflist branch from 006d7bb to 7adeae4 Compare February 25, 2015 23:28
add wm module and pb interface for GETing (and encoding) active preflist
@zeeshanlakhani zeeshanlakhani force-pushed the feature/zl/add-wm-code-for-getting-active-preflist branch from 7adeae4 to 9fede91 Compare February 25, 2015 23:48
@seancribbs
Copy link
Contributor

👍 9fede91

borshop added a commit that referenced this pull request Feb 27, 2015
…g-active-preflist

add wm code for getting active preflist

Reviewed-by: seancribbs
@zeeshanlakhani
Copy link
Contributor Author

@borshop merge

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.

3 participants