refactor(router): don't `emqx_broker_helper:monitor/1` in batches
As per out current understanding, this doesn't changes much in terms of observability, since other nodes call `ekka:monitor(membership)` anyway, so they will observe nodedowns without explicitly writing an entry into the `?ROUTING_NODE` table.
This commit is contained in:
parent
d6f731c4fc
commit
884f784c1c
|
@ -246,8 +246,6 @@ mria_delete_route(v1, Topic, Dest, Ctx) ->
|
||||||
|
|
||||||
-spec do_batch(batch()) -> #{batch_route() => _Error}.
|
-spec do_batch(batch()) -> #{batch_route() => _Error}.
|
||||||
do_batch(Batch) ->
|
do_batch(Batch) ->
|
||||||
Nodes = batch_get_dest_nodes(Batch),
|
|
||||||
ok = lists:foreach(fun emqx_router_helper:monitor/1, ordsets:to_list(Nodes)),
|
|
||||||
mria_batch(get_schema_vsn(), Batch).
|
mria_batch(get_schema_vsn(), Batch).
|
||||||
|
|
||||||
mria_batch(v2, Batch) ->
|
mria_batch(v2, Batch) ->
|
||||||
|
@ -266,20 +264,6 @@ mria_batch_v1(Batch) ->
|
||||||
Error
|
Error
|
||||||
end.
|
end.
|
||||||
|
|
||||||
batch_get_dest_nodes(Batch) ->
|
|
||||||
maps:fold(
|
|
||||||
fun({_Topic, Dest}, Op, Acc) ->
|
|
||||||
case batch_get_action(Op) of
|
|
||||||
add ->
|
|
||||||
ordsets:add_element(get_dest_node(Dest), Acc);
|
|
||||||
delete ->
|
|
||||||
Acc
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
ordsets:new(),
|
|
||||||
Batch
|
|
||||||
).
|
|
||||||
|
|
||||||
batch_get_action(Op) ->
|
batch_get_action(Op) ->
|
||||||
element(1, Op).
|
element(1, Op).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue