mix malachi.flag (malachi v0.22.7)

View Source

Reads and switches on the cluster's feature flags on a running Malachi node, over Erlang distribution (RPC).

mix malachi.flag --list
mix malachi.flag enable batch_format

A flag is the moment an operator commits to a feature that changes a format or a protocol. It is separate from finishing a rolling upgrade on purpose: while every node runs the new build and no flag is on, rolling the build back is still free.

Switching one on is refused unless every node in MALACHI_LOG_NODES is alive and advertises the capability the flag names, and the refusal says which nodes do not. Upgrade them, or take them out of the configured set, and run the command again. There is no command to switch a flag off: once a feature is on, peers and stored data may already be in the new shape, and going back is a migration.

Options:

  • --list: print the flags this build knows and which are on (no positional argument)
  • --node: the target node (default $MALACHI_NODE or malachi@127.0.0.1)
  • --cookie: the Erlang cookie (default $RELEASE_COOKIE, else ~/.erlang.cookie)

Summary

Functions

The testable core: lists or enables through call (a (module, fun, args -> {:ok, value} | {:error, reason}) seam that in production is an RPC to the target node). Returns {:ok, message} / {:error, message} for the caller to print.

Functions

execute(arg1, opts, call)

@spec execute([String.t()], keyword(), (module(), atom(), list() ->
                                    {:ok, term()} | {:error, term()})) ::
  {:ok, String.t()} | {:error, String.t()}

The testable core: lists or enables through call (a (module, fun, args -> {:ok, value} | {:error, reason}) seam that in production is an RPC to the target node). Returns {:ok, message} / {:error, message} for the caller to print.