From 9b34a3df92f5d254c4c0c3e9d1e616c1e75d69aa Mon Sep 17 00:00:00 2001 From: Martin Cox Date: Tue, 24 Mar 2020 08:38:47 +0000 Subject: [PATCH] Explicitly filter out non-primary exchanges from exchange_queue as opposed to flipping indexes and allowing it to fail. Prevents logging of not_responsible messages when these errorneous exchanges are attempted. --- src/riak_kv_entropy_manager.erl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/riak_kv_entropy_manager.erl b/src/riak_kv_entropy_manager.erl index 1ba646b0f7..4ba20083c4 100644 --- a/src/riak_kv_entropy_manager.erl +++ b/src/riak_kv_entropy_manager.erl @@ -956,11 +956,7 @@ add_index_exchanges(Index, State) -> -spec prune_exchanges([exchange()]) -> [exchange()]. prune_exchanges(Exchanges) -> - L = [if A < B -> - {A, B, IndexN}; - true -> - {B, A, IndexN} - end || {A, B, IndexN} <- Exchanges], + L = [Exchange || {A, B, _IndexN} = Exchange <- Exchanges, A < B], lists:usort(L). -spec already_exchanging(index() ,state()) -> boolean().