Skip to content
This repository
Browse code

Fix AAE exchange bug for the N=1 case

  • Loading branch information...
commit efc392ddc932c893859c575f1b188d33cc242232 1 parent 17cfd96
Joseph Blomstedt authored December 31, 2012

Showing 1 changed file with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. 10  src/riak_kv_entropy_manager.erl
10  src/riak_kv_entropy_manager.erl
@@ -642,9 +642,13 @@ next_exchange(_Ring, State=#state{exchange_queue=[],
642 642
                                   mode=Mode}) when Mode == manual ->
643 643
     {none, State};
644 644
 next_exchange(Ring, State=#state{exchange_queue=[]}) ->
645  
-    [Exchange|Rest] = prune_exchanges(all_exchanges(node(), Ring, State)),
646  
-    State2 = State#state{exchange_queue=Rest},
647  
-    {Exchange, State2};
  645
+    case prune_exchanges(all_exchanges(node(), Ring, State)) of
  646
+        [] ->
  647
+            {none, State};
  648
+        [Exchange|Rest] ->
  649
+            State2 = State#state{exchange_queue=Rest},
  650
+            {Exchange, State2}
  651
+    end;
648 652
 next_exchange(_Ring, State=#state{exchange_queue=Exchanges}) ->
649 653
     [Exchange|Rest] = Exchanges,
650 654
     State2 = State#state{exchange_queue=Rest},

0 notes on commit efc392d

Please sign in to comment.
Something went wrong with that request. Please try again.