fix(mnesia): per-slot volumes hint and harden verification lookup.
Avoid shared Mnesia dir across replicas; make get_or_create_token and CT verify_user resilient to brief cross-node lag. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -229,7 +229,7 @@ add_local_ram_copy(Tab) ->
|
||||
end.
|
||||
|
||||
wait_for_tables_available() ->
|
||||
lists:foreach(fun(Tab) -> wait_for_table(Tab) end, ?DISC_TABLES).
|
||||
lists:foreach(fun(Tab) -> wait_for_table(Tab) end, ?DISC_TABLES ++ ?RAM_TABLES).
|
||||
|
||||
wait_for_table(Tab) ->
|
||||
case lists:member(Tab, mnesia:system_info(tables)) of
|
||||
@@ -260,6 +260,12 @@ prune_dead_nodes() ->
|
||||
false -> ok
|
||||
end
|
||||
end, ?DISC_TABLES),
|
||||
lists:foreach(fun(Tab) ->
|
||||
case lists:member(Node, mnesia:table_info(Tab, ram_copies)) of
|
||||
true -> catch mnesia:del_table_copy(Tab, Node);
|
||||
false -> ok
|
||||
end
|
||||
end, ?RAM_TABLES),
|
||||
catch mnesia:del_table_copy(schema, Node)
|
||||
end, DeadNodes).
|
||||
|
||||
@@ -327,6 +333,7 @@ create_indices() ->
|
||||
mnesia:add_table_index(calendar_specialist, user_id),
|
||||
mnesia:add_table_index(user, nickname),
|
||||
mnesia:add_table_index(user, email),
|
||||
mnesia:add_table_index(verification, user_id),
|
||||
mnesia:add_table_index(notification, user_id),
|
||||
mnesia:add_table_index(notification, is_read),
|
||||
mnesia:add_table_index(auth_session, family_id),
|
||||
|
||||
Reference in New Issue
Block a user