Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mnesia: Discard old irrelevant msgs #9499

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions lib/mnesia/src/mnesia_controller.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1485,17 +1485,25 @@ orphan_tables([Tab | Tabs], Node, Ns, Local, Remote) ->
orphan_tables([], _, _, LocalOrphans, RemoteMasters) ->
{LocalOrphans, RemoteMasters}.

node_has_tabs([Tab | Tabs], Node, State) when Node /= node() ->
State2 =
try update_whereabouts(Tab, Node, State) of
State1 = #state{} -> State1
catch exit:R -> %% Tab was just deleted?
case ?catch_val({Tab, cstruct}) of
{'EXIT', _} -> State; % yes
_ -> erlang:error(R)
end
end,
node_has_tabs(Tabs, Node, State2);
node_has_tabs([Tab | Tabs], Node, State0) when Node /= node() ->
State = try
case ?catch_val({Tab, cstruct}) of
{'EXIT', _} -> State0;
Cs ->
case mnesia_lib:cs_to_storage_type(Node, Cs) of
unknown -> %% handle_early_msgs may come with obsolete
State0; %% information, if irrelevant ignore it.
_ ->
#state{} = update_whereabouts(Tab, Node, State0)
end
end
catch exit:R:ST -> %% Tab was just deleted?
case ?catch_val({Tab, cstruct}) of
{'EXIT', _} -> State0; % yes
_ -> erlang:error({R, ST})
end
end,
node_has_tabs(Tabs, Node, State);
node_has_tabs([Tab | Tabs], Node, State) ->
user_sync_tab(Tab),
node_has_tabs(Tabs, Node, State);
Expand Down
Loading