Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

active preflist on bucket key #705

Merged
merged 1 commit into from
Feb 25, 2015

Conversation

zeeshanlakhani
Copy link
Contributor

Returns active preflist as

[{{34,
  'dev5@127.0.0.1'},
  primary},
{{35,
  'dev6@127.0.0.1'},
  primary},
...]

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, RiakCore, and RiakAPI.

*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:

get_apl_ann(DocIdx, N, Ring, UpNodes)].

%% Get the active preflist taking account of which nodes are up
%% and annotate each node with type of primary/fallback
%% Get the active preflist taking account of which nodes are up and
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a @doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

derp. definitely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cmeiklejohn updated. realized i didn't have a @doc there b/c that module is completely lacking of them. Will one day go through and fix up I reckon.

@zeeshanlakhani
Copy link
Contributor Author

I'll @doc all the things in this module for consistency.

@cmeiklejohn
Copy link
Contributor

Has anyone explored how this works during ring resizing? Do we need to worry about that at all?

@zeeshanlakhani
Copy link
Contributor Author

I'm going to say that it's probably not a problem we should worry about in relation to this. If they are resizing their ring, they're dealing w/ other problems/issues.

@cmeiklejohn
Copy link
Contributor

How about a nice rebase/squash to wrap this one up?

@zeeshanlakhani
Copy link
Contributor Author

yes sir.

@zeeshanlakhani zeeshanlakhani force-pushed the feature/zl/retrieve-active-preflist-on-bucket-key branch 2 times, most recently from b4807c5 to c00f3af Compare February 21, 2015 20:01
%% Same as get_apl, but returns only the primaries.
%% @doc Get the active preflist for a given {bucket, key} and list of nodes
%% and annotate each node with type of primary/fallback.
-spec get_apl_ann({binary(), binary()}, [node()]) -> preflist_ann().
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 will be wrong when considering bucket-types. Better to use bucket(), wherever it is defined.

@zeeshanlakhani zeeshanlakhani force-pushed the feature/zl/retrieve-active-preflist-on-bucket-key branch from c00f3af to 5f6cf05 Compare February 23, 2015 19:04
-type iterator() :: term().
-type chashbin() :: term().
-type docidx() :: chash:index().
-type partition_id() :: non_neg_integer().
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the back-and-forth. Is this not riak_core_ring:partition_id()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

derp, meant to remove it. My bad.

@zeeshanlakhani zeeshanlakhani force-pushed the feature/zl/retrieve-active-preflist-on-bucket-key branch from 5f6cf05 to ae49081 Compare February 23, 2015 21:42
@zeeshanlakhani zeeshanlakhani force-pushed the feature/zl/retrieve-active-preflist-on-bucket-key branch from ae49081 to 97e6903 Compare February 23, 2015 21:55
@seancribbs
Copy link
Contributor

👍 97e6903

borshop added a commit that referenced this pull request Feb 25, 2015
…t-on-bucket-key

active preflist on bucket key

Reviewed-by: seancribbs
@zeeshanlakhani
Copy link
Contributor Author

@borshop merge

@borshop borshop merged commit 97e6903 into develop Feb 25, 2015
@martincox martincox deleted the feature/zl/retrieve-active-preflist-on-bucket-key branch June 14, 2019 09:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants