View Source cets_join (cets v0.3.0)

Cluster join logic.

Join is called for each table by the discovery process.

Checkpoints are used for testing and do not affect the joining logic.

Summary

Types

Critical events during the joining procedure.

Checkpoint function for debugging.

Joining options.

An unique ID assigned during the table join attempt.

Pid of CETS gen_server.

Types

-type checkpoint() ::
          join_start | before_retry | before_get_pids | before_check_fully_connected | before_unpause |
          {before_send_dump, server_pid()} |
          {after_send_dump, server_pid(), Result :: term()}.

Critical events during the joining procedure.

-type checkpoint_handler() :: fun((checkpoint()) -> ok).

Checkpoint function for debugging.

-type join_opts() :: #{checkpoint_handler => checkpoint_handler(), join_ref => reference()}.

Joining options.

-type join_ref() :: reference().

An unique ID assigned during the table join attempt.

-type lock_key() :: term().

Key for global:trans/4.

-type rpc_result() :: {Class :: throw | exit | error, Reason :: term()} | {ok, ok}.

Pid of CETS gen_server.

-type server_pid() :: cets:server_pid().

Functions

Link to this function

join(LockKey, Info, LocalPid, RemotePid)

View Source
-spec join(lock_key(), cets_long:log_info(), server_pid(), server_pid()) -> ok | {error, term()}.

Join two clusters with default options.

Link to this function

join(LockKey, Info, Pid, RemotePid, JoinOpts)

View Source
-spec join(lock_key(), cets_long:log_info(), pid(), pid(), join_opts()) -> ok | {error, term()}.

Join two clusters.

Writes would wait for join completion.

Link to this function

pause_on_remote_node(JoinerPid, AllPids)

View Source
-spec pause_on_remote_node(pid(), [pid()]) -> ok.