View Source cets_join (cets v0.2.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.Link to this section Summary
Types
Critical events during the joining procedure.
Checkpoint function for debugging.
Joining options.
An unique ID assigned during the table join attempt.
Key for
global:trans/4
.Pid of CETS gen_server.
Link to this section 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()}.
-type checkpoint_handler() :: fun((checkpoint()) -> ok).
-type join_opts() :: #{checkpoint_handler => checkpoint_handler(), join_ref => reference()}.
-type join_ref() :: reference().
-type lock_key() :: term().
global:trans/4
.
-type rpc_result() :: {Class :: throw | exit | error, Reason :: term()} | {ok, ok}.
-type server_pid() :: cets:server_pid().
Link to this section Functions
-spec join(lock_key(), cets_long:log_info(), server_pid(), server_pid()) -> ok | {error, term()}.
-spec join(lock_key(), cets_long:log_info(), pid(), pid(), join_opts()) -> ok | {error, term()}.
Join two clusters.
Writes would wait for join completion.-spec pause_on_remote_node(pid(), [pid()]) -> ok.