([email protected])3> [C:put(riak_object:new(<<"bucket">>, list_to_binary(integer_to_list(X)), <<"val">>)) || X <- lists:seq(1,100)].
([email protected])5> Props = riak_core_bucket:get_bucket(<<"bucket">>).
[{name,<<"bucket">>},
{allow_mult,true},
{basic_quorum,false},
{big_vclock,50},
{chash_keyfun,{riak_core_util,chash_std_keyfun}},
{dw,quorum},
{last_write_wins,false},
{linkfun,{modfun,riak_kv_wm_link_walker,mapreduce_linkfun}},
{n_val,3},
{notfound_ok,true},
{old_vclock,86400},
{postcommit,[]},
{pr,0},
{precommit,[]},
{pw,0},
{r,quorum},
{rw,quorum},
{small_vclock,50},
{w,quorum},
{young_vclock,20}]
([email protected])6> UpdProps = [{n_val,2} | proplists:delete(n_val, Props)].
[{n_val,2},
{name,<<"bucket">>},
{allow_mult,true},
{basic_quorum,false},
{big_vclock,50},
{chash_keyfun,{riak_core_util,chash_std_keyfun}},
{dw,quorum},
{last_write_wins,false},
{linkfun,{modfun,riak_kv_wm_link_walker,mapreduce_linkfun}},
{notfound_ok,true},
{old_vclock,86400},
{postcommit,[]},
{pr,0},
{precommit,[]},
{pw,0},
{r,quorum},
{rw,quorum},
{small_vclock,50},
{w,quorum},
{young_vclock,20}]
([email protected])13> {ok, NVal3Keys} = C:list_keys(<<"bucket">>).
{ok,[<<"54">>,<<"30">>,<<"28">>,<<"21">>,<<"63">>,<<"3">>,
<<"29">>,<<"2">>,<<"82">>,<<"24">>,<<"95">>,<<"93">>,
<<"9">>,<<"86">>,<<"52">>,<<"50">>,<<"47">>,<<"32">>,
<<"100">>,<<"96">>,<<"78">>,<<"75">>,<<"59">>,<<"99">>,
<<"49">>,<<"46">>,<<...>>|...]}
([email protected])14> length(NVal3Keys).
100
([email protected])15> length(lists:usort(NVal3Keys)).
100
([email protected])16> riak_core_bucket:set_bucket(<<"bucket">>, UpdProps).
ok
([email protected])17> {ok, NVal2Keys} =C:list_kkes(<""bbukket>>>).
{ok,[<<"58">>,<<"28">>,<<"95">>,<<"93">>,<<"9">>,<<"86">>,
<<"52">>,<<"50">>,<<"47">>,<<"32">>,<<"100">>,<<"90">>,
<<"60">>,<<"89">>,<<"63">>,<<"3">>,<<"2">>,<<"88">>,
<<"79">>,<<"77">>,<<"65">>,<<"38">>,<<"23">>,<<"20">>,
<<"15">>,<<"94">>,<<...>>|...]}
([email protected])18> length(NVal2Keys).
154
([email protected])19> length(lists:usort(NVal2Keys)).
100
Last active
August 29, 2015 14:05
-
-
Save kellymclaughlin/de3979f77192e1981581 to your computer and use it in GitHub Desktop.
Effects on Riak key listings when reducing n_val from 3 to 2
This output compares the coverage plan calculated for the same bucket. The first shows with n_val=3
and the second with n_val=2
.
Coverage plan with n_val=3
:
2014-08-15 15:20:07.900 [info] <0.2972.0>@riak_core_coverage_fsm:initialize:223 CoveragePlan: {[{0,'[email protected]'},
{68507889249886074290797726533575766546371837952,'[email protected]'},{137015778499772148581595453067151533092743675904,'[email protected]'},
{205523667749658222872393179600727299639115513856,'[email protected]'},{274031556999544297163190906134303066185487351808,'[email protected]'},
{342539446249430371453988632667878832731859189760,'[email protected]'},{411047335499316445744786359201454599278231027712,'[email protected]'},
{479555224749202520035584085735030365824602865664,'[email protected]'},{548063113999088594326381812268606132370974703616,'[email protected]'},
{616571003248974668617179538802181898917346541568,'[email protected]'},{685078892498860742907977265335757665463718379520,'[email protected]'},
{753586781748746817198774991869333432010090217472,'[email protected]'},{822094670998632891489572718402909198556462055424,'[email protected]'},
{890602560248518965780370444936484965102833893376,'[email protected]'},{959110449498405040071168171470060731649205731328,'[email protected]'},
{1027618338748291114361965898003636498195577569280,'[email protected]'},{1096126227998177188652763624537212264741949407232,'[email protected]'},
{1164634117248063262943561351070788031288321245184,'[email protected]'},{1233142006497949337234359077604363797834693083136,'[email protected]'},
{1301649895747835411525156804137939564381064921088,'[email protected]'},{1370157784997721485815954530671515330927436759040,'[email protected]'},
{1392993748081016843912887106182707253109560705024,'[email protected]'}],[{1392993748081016843912887106182707253109560705024,
[1392993748081016843912887106182707253109560705024]}]}
Coverage plan with n_val=2
:
2014-08-15 15:23:40.029 [info] <0.4583.0>@riak_core_coverage_fsm:initialize:223 CoveragePlan: {[{0,'[email protected]'},
{45671926166590716193865151022383844364247891968,'[email protected]'},{91343852333181432387730302044767688728495783936,'[email protected]'},
{137015778499772148581595453067151533092743675904,'[email protected]'},{182687704666362864775460604089535377456991567872,'[email protected]'},
{228359630832953580969325755111919221821239459840,'[email protected]'},{274031556999544297163190906134303066185487351808,'[email protected]'},
{319703483166135013357056057156686910549735243776,'[email protected]'},{365375409332725729550921208179070754913983135744,'[email protected]'},
{411047335499316445744786359201454599278231027712,'[email protected]'},{456719261665907161938651510223838443642478919680,'[email protected]'},
{502391187832497878132516661246222288006726811648,'[email protected]'},{548063113999088594326381812268606132370974703616,'[email protected]'},
{593735040165679310520246963290989976735222595584,'[email protected]'},{639406966332270026714112114313373821099470487552,'[email protected]'},
{685078892498860742907977265335757665463718379520,'[email protected]'},{730750818665451459101842416358141509827966271488,'[email protected]'},
{776422744832042175295707567380525354192214163456,'[email protected]'},{822094670998632891489572718402909198556462055424,'[email protected]'},
{867766597165223607683437869425293042920709947392,'[email protected]'},{913438523331814323877303020447676887284957839360,'[email protected]'},
{959110449498405040071168171470060731649205731328,'[email protected]'},{1004782375664995756265033322492444576013453623296,'[email protected]'},
{1050454301831586472458898473514828420377701515264,'[email protected]'},{1096126227998177188652763624537212264741949407232,'[email protected]'},
{1141798154164767904846628775559596109106197299200,'[email protected]'},{1187470080331358621040493926581979953470445191168,'[email protected]'},
{1233142006497949337234359077604363797834693083136,'[email protected]'},{1278813932664540053428224228626747642198940975104,'[email protected]'},
{1324485858831130769622089379649131486563188867072,'[email protected]'},{1370157784997721485815954530671515330927436759040,'[email protected]'},
{1415829711164312202009819681693899175291684651008,'[email protected]'}],[]}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment