View Source partisan_config (partisan v5.0.0-beta.24)

This module handles the validation, access and modification of Partisan configuration options. Some options will only take effect after a restart of the Partisan application, while other will take effect while the application is still running.

As per Erlang convention the options are given using the sys.config file under the partisan application section.

options

Options

The following is the list of all the options you can read using get/ 1 and get/2, and modify using the sys.config file and set/ 2.

See Deprecated Options below.

binary_padding
A boolean value indicating whether to pad encoded messages whose external binary representation consumes less than 65 bytes.
broadcast
TBD
broadcast_mods
TBD
causal_labels
TBD
channels
Defines the channels to be used by Partisan. The option takes either a channels map where keys are channel names (partisan:channel()) and values are channel options (partisan:channel_opts()), or a list of values where each value can be any of the following types:
  • a channel name (partisan:channel()) e.g. the atom foo
  • a channel with options: {channel(), channel_opts()}
  • a monotonic channel using the tuple {monotonic, Name :: channel()} e.g. {monotonic, bar}. This is a legacy representation, the same can be achieved with {bar, #{monotonic => true}}

The list can habe a mix of types and during startup they are all coerced to channels map. Coercion works by defaulting the channel's parallelism to the value of the global option parallelism (which itself defaults to 1), and the channel's monotonic to false.

Finally the list is transformed to a map where keys are channel names and values are channel map representation.

Example:

Given the following option value:
  [
      foo,
      {monotonic, bar},
      {bar, #{parallelism => 4}}
  ]
The coerced representation will be the following map (which is a valid input and the final representation of this option after Partisan starts).
  #{
      foo => #{monotonic => false, parallelism => 1},
      bar => #{monotonic => true, parallelism => 1},
      baz => #{monotonic => false, parallelism => 4},
  }
connect_disterl
Whether to use distributed erlang in addition to Partisan channels. This is used for testing and only works for partisan_full_membership_strategy (See membership_strategy). Defaults to false
connection_interval
Interval of time between peer connection attempts
connection_jitter
TBD
disable_fast_forward
TBD
disable_fast_receive
TBD
distance_enabled
TBD
egress_delay
TBD
exchange_selection
TBD
exchange_tick_period
TBD
gossip
If true gossip is used to disseminate membership state.
hyparview

The configuration for the partisan_hyparview_peer_service_manager. A list with the following properties:

active_max_size
Defaults to 6.
active_min_size
Defaults to 3.
active_rwl
Active View Random Walk Length. Defaults to 6.
passive_max_size
Defaults to 30.
passive_rwl
Passive View Random Walk Length. Defaults to 6.
random_promotion
A boolean indicating if random promotion is enabled. Defaults true.
random_promotion_interval
Time after which the protocol attempts to promote a node in the passive view to the active view. Defaults to 5000.
shuffle_interval
Defaults to 10000.
shuffle_k_active
Number of peers to include in the shuffle exchange. Defaults to 3.
shuffle_k_passive
Number of peers to include in the shuffle exchange. Defaults to 4.
ingress_delay
TBD
lazy_tick_period
TBD
membership_binary_compression
A boolean value or an integer in the range from 0..9 to be used with erlang:term_to_binary/2 when encoding the membership set for broadcast. A value of true is equivalent to integer 6 (equivalent to option compressed in erlang:term_to_binary/2). A value of false is equivalent to 0 (no compression). Default is true.
membership_strategy
The membership strategy to be used with partisan_pluggable_peer_service_manager. Default is partisan_full_membership_strategy
membership_strategy_tracing
TBD
name
TBD
orchestration_strategy
TBD
parallelism
TBD
peer_service_manager
The peer service manager to be used. An implementation of the partisan_peer_service_manager behaviour which defines the overlay network topology and the membership view maintenance strategy. Default is partisan_pluggable_peer_service_manager.
peer_host
TBD
peer_ip
TBD
peer_port
TBD
periodic_enabled
TBD
periodic_interval
TBD
pid_encoding
TBD
random_seed
TBD
ref_encoding
TBD
register_pid_for_encoding
TBD
remote_ref_format

If uri partisan remote references (see module partisan_remote_ref) will be encoded as a URI binary, if tuple it will be encoded as a tuple (the format used by Partisan v1 to v4). Otherwise, if improper_list it will be encoded as an improper list, similar to how aliases are encoded by the OTP modules. This option exists to allow the user to tradeoff between memory and latency. In terms of memory uri is the cheapest, followed by improper_list. In terms of latency tuple is the fastest followed by improper_list. The default is improper_list a if offers a good balance between memory and latency.

  1> partisan_config:set(remote_ref_format, uri).
  ok
  2> partisan_remote_ref:from_term(self()).
  <<"partisan:pid:nonode@nohost:0.1062.0">>
  3> partisan_config:set(remote_ref_format, tuple).
  4> partisan_remote_ref:from_term(self()).
  {partisan_remote_reference,
     nonode@nohost,
     {partisan_process_reference,"<0.1062.0>"}}
  5> partisan_config:set(remote_ref_format, improper_list).
  6> partisan_remote_ref:from_term(self()).
  [nonode@nohost|<<"Pid#<0.1062.0>">>]
remote_ref_uri_padding
If true and the URI encoding of a remote reference results in a binary smaller than 65 bytes, the URI will be padded. The default is false. %%
  1> partisan_config:set(remote_ref_binary_padding, false).
  1> partisan_remote_ref:from_term(self()).
  <<"partisan:pid:nonode@nohost:0.1062.0">>
  2> partisan_config:set(remote_ref_binary_padding, true).
  ok
  3> partisan_remote_ref:from_term(self()).
  <<"partisan:pid:nonode@nohost:0.1062.0:"...>>
replaying
TBD
reservations
TBD
retransmit_interval
Interval of time between retransmission attempts
shrinking
TBD
tag
The role of this node when using partisan_client_server_peer_manager. Values can beclient or server. Use undefined when using a different peer service manager.
tls
a boolean value indicating whether channel connections should use TLS. If enabled, you have to provide a value for tls_client_options and tls_server_options. The default is false.
tls_client_options
The default is [].
tls_server_options
The default is [].
tracing
a boolean value. The default is false.
xbot_interval
TBD

deprecated-options

Deprecated Options

The following is the list of options have been deprecated. Some of them have been renamed and/or moved down a level in the configuration tree.

arwl
HyParView's Active View Random Walk Length. Defaults to 6. Use active_rwl in the hyparview option instead.
fanout
The number of nodes that are contacted at each gossip interval.
max_active_size
HyParView's Active View Random Walk Length. Defaults to 6. Use active_max_size in the hyparview option instead.
max_passive_size
HyParView's Active View Random Walk Length. Defaults to 30. Use passive_max_size in the hyparview option instead.
mix_active_size
HyParView's Active View Random Walk Length. Defaults to 3. Use active_min_size in the hyparview option instead.
passive_view_shuffle_period
Use shuffle_interval in the hyparview option instead.
partisan_peer_service_manager
Use peer_service_manager instead.
prwl
HyParView's Passive View Random Walk Length. Defaults to 6. Use passive_rwl in the hyparview option instead.
random_promotion
Use random_promotion in the hyparview option instead.
random_promotion_period
Use random_promotion_interval in the hyparview option instead.
remote_ref_as_uri
Use {remote_ref_format, uri} instead

Link to this section Summary

Functions

The name of the default channel.
The spec of the default channel.
Returns the value for Key in Opts, if found. Otherwise, calls get/1.
Returns the value for Key in Opts, if found. Otherwise, calls get/2.

Initialises the configuration from the application environment.

Seed the process.
Seed the process.

Link to this section Functions

-spec channel_opts(Name :: partisan:channel()) -> partisan:channel_opts().
-spec channels() -> #{partisan:channel() => partisan:channel_opts()}.
-spec default_channel() -> partisan:channel().
The name of the default channel.
-spec default_channel_opts() -> partisan:channel_opts().
The spec of the default channel.
Link to this function

get_with_opts(Key, Opts)

View Source
Returns the value for Key in Opts, if found. Otherwise, calls get/1.
Link to this function

get_with_opts(Key, Opts, Default)

View Source
Returns the value for Key in Opts, if found. Otherwise, calls get/2.

Initialises the configuration from the application environment.

You should never call this function. This is used by Partisan itself during startup. The function is (and should be) idempotent, which is required for testing.
Seed the process.
Seed the process.