File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -442,17 +442,25 @@ become_leader0(QName, Name) ->
442442all_replica_states () ->
443443 Rows0 = ets :tab2list (ra_state ),
444444 Rows = lists :map (fun
445- ( {K , follower , promotable }) ->
446- { K , promotable };
447- ({ K , follower , non_voter }) ->
448- { K , non_voter } ;
449- ({ K , S , _ }) ->
450- % % voter or unknown
451- { K , S } ;
452- ( T ) ->
453- T
445+ ( T = {K , _ , _ }) ->
446+ case rabbit_process : is_registered_process_alive ( K ) of
447+ true ->
448+ to_replica_state ( T ) ;
449+ false ->
450+ []
451+ end ;
452+ ( _T ) ->
453+ []
454454 end , Rows0 ),
455- {node (), maps :from_list (Rows )}.
455+ {node (), maps :from_list (lists :flatten (Rows ))}.
456+
457+ to_replica_state ({K , follower , promotable }) ->
458+ {K , promotable };
459+ to_replica_state ({K , follower , non_voter }) ->
460+ {K , non_voter };
461+ to_replica_state ({K , S , _ }) ->
462+ % % voter or unknown
463+ {K , S }.
456464
457465- spec list_with_minimum_quorum () -> [amqqueue :amqqueue ()].
458466list_with_minimum_quorum () ->
You can’t perform that action at this time.
0 commit comments