basho/riak_kv — pull request #1008 by andrewjstone (2014-08-01 20:11:32+00:00)
Title: Use SC bucket types and buckets to know ensembles

If we use a default bucket property with a different n_val from the
strongly consistent bucket type, ensembles for that bucket type will
never be created. The problem seems to stem from the fact that
riak_kv_ensembles:required_ensembles/1 checks all current bucket n_vals
for ensembles to create, but doesn't check bucket types that don't yet
have buckets created. Since all buckets are created on demand with a
put, and it's not possible to put if the ensemble doesn't exist, the
buckets and ensembles never get created.

To fix this we now iterate through all bucket types and collect all
n_vals from them, as well as the n_vals from the existing buckets in
order to figure out the set of all n_vals required to create ensembles.

Requires a corresponding riak_core PR and riak_test to show the issue. Those are coming shortly.

Fixes #1007