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:
Andrew Mayorov 2024-01-10 19:20:26 +01:00
parent d6f731c4fc
commit 884f784c1c
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 0 additions and 16 deletions

View File

@ -246,8 +246,6 @@ mria_delete_route(v1, Topic, Dest, Ctx) ->
-spec do_batch(batch()) -> #{batch_route() => _Error}.
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(v2, Batch) ->
@ -266,20 +264,6 @@ mria_batch_v1(Batch) ->
Error
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) ->
element(1, Op).