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,infoorfail(error); processis present and is an integer for clients or a string for nemeses (error);- for a string (nemesis)
process, type isinfo(error); - for a numeric (client)
process: - an
invokedoes not follow an unfinishedinvoke(error); - an
invokedoes not follow aninfocompletion, i.e. no invocation by a crashed process (error); - a completion (
ok,fail,info) follows aninvoke(error); - if
indexis present, it is a numeric integer (error), unique (error) and strictly ascending (error); a duplicate is reported once; timeis present and is a numeric integer (error) and monotonic (warning);- no
invokeis 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
truetogether with a non-empty list of findings.Parameters:
- x History object or array of operations.
Returns:
-
boolean, table|nil