Skip to content

Commit

Permalink
Merge pull request #989 from basho/feature/dont-start-peer-until-back…
Browse files Browse the repository at this point in the history
…end-ready

SC ensemble peers should wait for riak_kv service

Reviewed-by: lordnull
  • Loading branch information
borshop committed Jun 23, 2014
2 parents 5724572 + 0948bd4 commit d53beda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/riak_kv_ensemble_backend.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
-export([init/3, new_obj/4]).
-export([obj_epoch/1, obj_seq/1, obj_key/1, obj_value/1]).
-export([set_obj_epoch/2, set_obj_seq/2, set_obj_value/2]).
-export([get/3, put/4, tick/5, ping/2]).
-export([get/3, put/4, tick/5, ping/2, ready_to_start/0]).
-export([trusted/1, sync_request/2, sync/2]).
-export([reply/2]).
-export([obj_newer/2]).
Expand Down Expand Up @@ -294,3 +294,8 @@ maybe_async_update(Changes, State=#state{async=Async}) ->
ping(From, State=#state{proxy=Proxy}) ->
catch Proxy ! {ensemble_ping, From},
{async, State}.

-spec ready_to_start() -> boolean().
ready_to_start() ->
lists:member(riak_kv, riak_core_node_watcher:services(node())).

0 comments on commit d53beda

Please sign in to comment.