From e46055728831cad766a704eba0bf6304d08093ae Mon Sep 17 00:00:00 2001 From: Giovanni Visciano Date: Mon, 20 May 2024 10:53:12 +0200 Subject: [PATCH] dets:sync/1 only in deinit stage --- src/ra_directory.erl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ra_directory.erl b/src/ra_directory.erl index db7f010b..bf96c71d 100644 --- a/src/ra_directory.erl +++ b/src/ra_directory.erl @@ -77,14 +77,12 @@ register_name(#{directory := Directory, ClusterName}), case uid_of(System, ServerName) of undefined -> - ok = dets:insert(DirRev, {ServerName, UId}), - ok = dets:sync(DirRev); + ok = dets:insert(DirRev, {ServerName, UId}); UId -> %% no need to insert into dets table if already there ok; OtherUId -> ok = dets:insert(DirRev, {ServerName, UId}), - ok = dets:sync(DirRev), ?WARN("ra server with name ~ts UId ~s replaces prior UId ~s", [ServerName, UId, OtherUId]), ok @@ -98,7 +96,6 @@ unregister_name(#{directory := Directory, case ets:take(Directory, UId) of [{_, _, _, ServerName, _}] -> ok = dets:delete(DirRev, ServerName), - ok = dets:sync(DirRev), UId; [] -> UId