Strong consistent buckets ready after starting a cluster.

Sargun Dhillon sargun at sargun.me
Fri Feb 6 15:41:58 EST 2015


I really don't recommend doing this. Really, the cluster shouldn't be
changing often enough where the ensemble status is changing all that
often. You can do this by exploiting internal APIs that are accessible
over distributed Erlang in riak_ensemble. Though, connecting to the
cluster over distributed Erlang from your client is probably also less
than recommended because it adds extra complexity, and you're poking
at internal APIs that aren't meant to be exposed to the client.

If you want to know for your own sake, you can look at the output from
'riak-admin ensemble-status'

In order to do this programmatically, you'd want to hook into
riak_ensemble_manager, and interrogate it for the status of the
ensembles. I would start by looking at the code in
riak_kv/riak_kv_ensemble_console.erl to go down this route.

On Mon, Feb 2, 2015 at 3:35 AM, Zsolt Laky <zsolt.laky at lamardan.com> wrote:
> Hi All!
>
> I am using a dev cluster with three nodes on a Mac OS. After a boot, I start
> the nodes and they are ok immediately for the default buckets, but for the
> strong consistent type it took 10 minutes to get ready and perform as
> expected.
>
> Here is a small example where a get returns with different values and at the
> end it is ok and I can be sure the RIAK cluster is up and running for strong
> consistent buckets. At the very beginning of startup I got
> {error,<<"insufficient_vnodes_available">>} replies but it is ok.
>
> My request for help is to find a way when I know the cluster is ready. I
> understand, RIAK needs time to sync all the nodes after startup, on the
> other hand I need to know when it gets ready for production and will give
> consistent answers. Is there a command in erlang to check it? I also attach
> part of the full log when I listed the keys and values in the buckets to see
> when would I get the correct result. It took about 10 minutes to get there.
>
> Thanks in advance for thoughts and suggestions, your help is highly
> appreciated.
> Kind regards,
> Zsolt
>
> ==============================
> Type:"strong"
> ------------------------
> Bucket:<<"Actors_msuser">>
> Key:"{msuser_actor,\"z2\",lamardan}" Value:Error:{error,<<"timeout">>}
> ------------------------
> Bucket:<<"Actors_mssession">>
> Key:"{mssession_actor,\"z2\",zschat,0}" Value:Error:{error,<<"timeout">>}
> ok
> ==============================
> Type:"strong"
> ------------------------
> Bucket:<<"Actors_msuser">>
> Key:"{msuser_actor,\"z2\",lamardan}" Value:Error:{error,<<"failed">>}
> ------------------------
> Bucket:<<"Actors_mssession">>
> Key:"{mssession_actor,\"z2\",zschat,0}" Value:Error:{error,<<"timeout">>}
> ==============================
> Type:"strong"
> ------------------------
> Bucket:<<"Actors_msuser">>
> Key:"{msuser_actor,\"z2\",lamardan}" Value:Error:{error,<<"failed">>}
> ------------------------
> Bucket:<<"Actors_mssession">>
> Key:"{mssession_actor,\"z2\",zschat,0}" Value:Error:{error,<<"failed">>}
> ==============================
> Type:"strong"
> ------------------------
> Bucket:<<"Actors_msuser">>
> ...........................
> Key:"{msuser_actor,\"z2\",lamardan}" Value:Error:{error,notfound}
> ------------------------
> Bucket:<<"Actors_mssession">>
> Key:"{mssession_actor,\"z2\",zschat,0}" Value:Error:{error,notfound}
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> http://www.avast.com
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>




More information about the riak-users mailing list