|
@@ -256,16 +256,16 @@ handle_cast({sync_register, Name, RemotePid, RemoteMeta}, State) ->
|
|
|
%% get remote node
|
|
|
RemoteNode = node(RemotePid),
|
|
|
%% check for conflicts
|
|
|
- case find_registry_entry_by_name(Name) of
|
|
|
+ case find_registry_tuple_by_name(Name) of
|
|
|
undefined ->
|
|
|
%% no conflict
|
|
|
add_to_local_table(Name, RemotePid, RemoteMeta, undefined);
|
|
|
|
|
|
- {Name, RemotePid, _Meta, MonitorRef, _Node} ->
|
|
|
+ {Name, RemotePid, _Meta} ->
|
|
|
%% same process, no conflict, overwrite
|
|
|
- add_to_local_table(Name, RemotePid, RemoteMeta, MonitorRef);
|
|
|
+ add_to_local_table(Name, RemotePid, RemoteMeta, undefined);
|
|
|
|
|
|
- {Name, TablePid, TableMeta, MonitorRef, _Node} ->
|
|
|
+ {Name, TablePid, TableMeta} ->
|
|
|
%% different pid, we have a conflict
|
|
|
global:trans({{?MODULE, {inconsistent_name, Name}}, self()},
|
|
|
fun() ->
|
|
@@ -276,7 +276,7 @@ handle_cast({sync_register, Name, RemotePid, RemoteMeta}, State) ->
|
|
|
|
|
|
CallbackIfLocal = fun() ->
|
|
|
%% keeping local: overwrite local data to remote node
|
|
|
- ok = rpc:call(RemoteNode, syn_registry, add_to_local_table, [Name, TablePid, TableMeta, MonitorRef])
|
|
|
+ ok = rpc:call(RemoteNode, syn_registry, add_to_local_table, [Name, TablePid, TableMeta, undefined])
|
|
|
end,
|
|
|
resolve_conflict(Name, {TablePid, TableMeta}, {RemotePid, RemoteMeta}, CallbackIfLocal, State),
|
|
|
|
|
@@ -460,7 +460,7 @@ unregister_on_node(Name) ->
|
|
|
|
|
|
-spec add_to_local_table(Name :: any(), Pid :: pid(), Meta :: any(), MonitorRef :: undefined | reference()) -> ok.
|
|
|
add_to_local_table(Name, Pid, Meta, MonitorRef) ->
|
|
|
- %% remove entry if previous exists & get pre-existing monitor ref
|
|
|
+ %% remove entry if previous exists
|
|
|
case find_registry_tuple_by_name(Name) of
|
|
|
undefined ->
|
|
|
undefined;
|