Module molly.history

Module with functions that processes history of operations.

Functions

is_well_formed (x) Check whether a history is well-formed.


Functions

is_well_formed (x)
Check whether a history is well-formed.

Accepts a molly.history object (as a method) or a plain array of operations (as a function) and verifies the structure and semantics from the Jepsen history documentation.

Rules checked (severity in parentheses):

  • the history (or the history field of an object) is a table (error);
  • every operation is a table (error);
  • type is one of invoke, ok, info or fail (error);
  • process is present and is an integer for clients or a string for nemeses (error);
  • for a string (nemesis) process, type is info (error);
  • for a numeric (client) process:
  • an invoke does not follow an unfinished invoke (error);
  • an invoke does not follow an info completion, i.e. no invocation by a crashed process (error);
  • a completion (ok, fail, info) follows an invoke (error);
  • if index is present, it is a numeric integer (error), unique (error) and strictly ascending (error); a duplicate is reported once;
  • time is present and is a numeric integer (error) and monotonic (warning);
  • no invoke is left without a completion at the end (error).

"Numeric" means a Lua number or a numeric cdata value (for example, a Tarantool 64-bit monotonic clock). Warnings do not make a history invalid: the function then returns true together with a non-empty list of findings.

Parameters:

  • x History object or array of operations.

Returns:

    boolean, table|nil
generated by LDoc 1.5.0 Last updated 2026-10-22 11:22:25