Browse Source

Rename netsplits to consistency.

Roberto Ostinelli 10 years ago
parent
commit
01f7791122
6 changed files with 10 additions and 10 deletions
  1. 3 3
      README.md
  2. 1 1
      src/syn.app.src
  3. 1 1
      src/syn_consistency.erl
  4. 1 1
      src/syn_sup.erl
  5. 1 1
      test/syn-test.config
  6. 3 3
      test/syn_consistency_SUITE.erl

+ 3 - 3
README.md

@@ -9,7 +9,7 @@ Syn is a process registry that has the following features:
  * Global (i.e. a process is uniquely identified with a Key across all the nodes of a cluster).
  * Global (i.e. a process is uniquely identified with a Key across all the nodes of a cluster).
  * Any term can be used as Key.
  * Any term can be used as Key.
  * Fast writes.
  * Fast writes.
- * Automatically handles net splits.
+ * Automatically handles conflict resolution (such as net splits).
  * Configurable callbacks.
  * Configurable callbacks.
 
 
 
 
@@ -188,9 +188,9 @@ Set it in the options:
 If you don't set this option, no callback will be triggered.
 If you don't set this option, no callback will be triggered.
 
 
 #### Conflict resolution by callback
 #### Conflict resolution by callback
-After a net split, when nodes reconnect, Syn will merge the data from all the nodes in the cluster.
+In case of race conditions, or during net splits, a Key might be registered simultaneously on two different nodes. In this case, the cluster experiences a naming conflict.
 
 
-If the same Key was used to register a process on different nodes during a netsplit, then there will be a conflict. By default, Syn will discard the processes running on the node the conflict is being resolved on, and will kill it by sending a `kill` signal with `exit(Pid, kill)`.
+When this happens, Syn will resolve this conflict by choosing a single process. Syn will discard the processes running on the node the conflict is being resolved on, and by default will kill it by sending a `kill` signal with `exit(Pid, kill)`.
 
 
 If this is not desired, you can set the `conflicting_process_callback` option to instruct Syn to trigger a callback, so that you can perform custom operations (such as a graceful shutdown). In this case, the process will not be killed by Syn, and you'll have to decide what to do with it. This callback will be called only on the node where the process is running.
 If this is not desired, you can set the `conflicting_process_callback` option to instruct Syn to trigger a callback, so that you can perform custom operations (such as a graceful shutdown). In this case, the process will not be killed by Syn, and you'll have to decide what to do with it. This callback will be called only on the node where the process is running.
 
 

+ 1 - 1
src/syn.app.src

@@ -4,7 +4,7 @@
         {vsn, "0.1.0"},
         {vsn, "0.1.0"},
         {registered, [
         {registered, [
             syn_backbone,
             syn_backbone,
-            syn_netsplits
+            syn_consistency
         ]},
         ]},
         {applications, [
         {applications, [
             kernel,
             kernel,

+ 1 - 1
src/syn_netsplits.erl → src/syn_consistency.erl

@@ -29,7 +29,7 @@
 %% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 %% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 %% THE SOFTWARE.
 %% THE SOFTWARE.
 %% ==========================================================================================================
 %% ==========================================================================================================
--module(syn_netsplits).
+-module(syn_consistency).
 -behaviour(gen_server).
 -behaviour(gen_server).
 
 
 %% API
 %% API

+ 1 - 1
src/syn_sup.erl

@@ -54,6 +54,6 @@ start_link() ->
 init([]) ->
 init([]) ->
     Children = [
     Children = [
         ?CHILD(syn_backbone, worker),
         ?CHILD(syn_backbone, worker),
-        ?CHILD(syn_netsplits, worker)
+        ?CHILD(syn_consistency, worker)
     ],
     ],
     {ok, {{one_for_one, 10, 10}, Children}}.
     {ok, {{one_for_one, 10, 10}, Children}}.

+ 1 - 1
test/syn-test.config

@@ -19,7 +19,7 @@
         %% If this is not desired, you can set the conflicting_process_callback option here below to instruct Syn
         %% If this is not desired, you can set the conflicting_process_callback option here below to instruct Syn
         %% to trigger a callback, so that you can perform custom operations (such as a graceful shutdown).
         %% to trigger a callback, so that you can perform custom operations (such as a graceful shutdown).
 
 
-        {conflicting_process_callback, [syn_netsplits_SUITE, conflicting_process_callback_dummy]}
+        {conflicting_process_callback, [syn_consistency_SUITE, conflicting_process_callback_dummy]}
 
 
     ]}
     ]}
 
 

+ 3 - 3
test/syn_netsplits_SUITE.erl → test/syn_consistency_SUITE.erl

@@ -25,7 +25,7 @@
 %% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 %% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 %% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 %% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 %% THE SOFTWARE.
 %% THE SOFTWARE.
--module(syn_netsplits_SUITE).
+-module(syn_consistency_SUITE).
 
 
 %% callbacks
 %% callbacks
 -export([all/0]).
 -export([all/0]).
@@ -342,7 +342,7 @@ two_nodes_netsplit_callback_resolution_when_there_are_conflicts(Config) ->
 
 
     %% register global process
     %% register global process
     ResultPid = self(),
     ResultPid = self(),
-    global:register_name(syn_netsplits_SUITE_result, ResultPid),
+    global:register_name(syn_consistency_SUITE_result, ResultPid),
 
 
     %% register
     %% register
     ok = syn:register(conflicting_key, SlavePid),
     ok = syn:register(conflicting_key, SlavePid),
@@ -473,7 +473,7 @@ process_reply_main() ->
     receive
     receive
         shutdown ->
         shutdown ->
             timer:sleep(500), %% wait for global processes to propagate
             timer:sleep(500), %% wait for global processes to propagate
-            global:send(syn_netsplits_SUITE_result, {exited, self()})
+            global:send(syn_consistency_SUITE_result, {exited, self()})
     end.
     end.
 
 
 conflicting_process_callback_dummy(_Key, Pid) ->
 conflicting_process_callback_dummy(_Key, Pid) ->