File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -378,9 +378,18 @@ json_map_from_config(LocalAddr, BucketConfig) ->
378
378
Config = ns_config :get (),
379
379
json_map_with_full_config (LocalAddr , BucketConfig , Config ).
380
380
381
+ equal_len_chains ([]) ->
382
+ [];
383
+ equal_len_chains (Map ) ->
384
+ MaxChainLen = length (misc :min_by (fun (Chain , Max ) ->
385
+ length (Chain ) > length (Max )
386
+ end , Map )),
387
+ [Chain ++ lists :duplicate (MaxChainLen - length (Chain ), undefined )
388
+ || Chain <- Map ].
389
+
381
390
json_map_with_full_config (LocalAddr , BucketConfig , Config ) ->
382
391
NumReplicas = num_replicas (BucketConfig ),
383
- EMap = proplists :get_value (map , BucketConfig , []),
392
+ EMap = equal_len_chains ( proplists :get_value (map , BucketConfig , []) ),
384
393
BucketNodes = proplists :get_value (servers , BucketConfig , []),
385
394
ENodes = lists :delete (undefined , lists :usort (lists :append ([BucketNodes |
386
395
EMap ]))),
You can’t perform that action at this time.
0 commit comments