cets_join (cets v0.3.1)

View Source

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.

Types

checkpoint/0

-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.

checkpoint_handler/0

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

Checkpoint function for debugging.

join_opts/0

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

Joining options.

join_ref/0

-type join_ref() :: reference().

An unique ID assigned during the table join attempt.

lock_key/0

-type lock_key() :: term().

Key for global:trans/4.

server_pid/0

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

Functions

join(LockKey, Info, LocalPid, RemotePid)

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

Join two clusters with default options.

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

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

Join two clusters.

Writes would wait for join completion.

pause_on_remote_node(JoinerPid, AllPids)

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