Skip to main content

Module ops

Module ops 

Source
Expand description

Durable operations records and their state-machine guard.

Structs§

Lease
Run
Schedule

Enums§

RunState

Constants§

DEPLOY_EXPIRY_DAYS
Open deployment runs older than this many days are cancelled, so a push nobody approved does not stay open forever.
DEPLOY_KIND
The kind of a run that follows one file being sent to a node.
DEPLOY_MAX_ATTEMPTS
Failed applies of the same bytes before the run stops retrying and fails.

Functions§

acquire_lease
add_schedule
can_transition
complete_schedule_occurrence
Records the run and advances the due time atomically, avoiding replay after a process stops between those otherwise separate writes.
complete_schedule_occurrence_fenced
create_run
create_run_fenced
create_run_with_kind
Creates a manual or scheduled run with an explicit operation kind. A schedule remains authoritative when present; the explicit kind is used only for manually-triggered operations such as a restore drill.
deploy_dispatch
A push of sha256 to target on a node is held for a person (held) or has just been sent. Returns the run’s id. The same bytes reuse the open run; other bytes for the same target supersede it. Sending moves the run to Running and its one step to dispatching.
deploy_observed
The node says which bytes target holds now. A run for exactly those bytes succeeded even if its result never arrived (a lock, a crash, a lost reply); the interrupted step is settled here.
deploy_result
The node reported how applying sha256 went. A success ends the run; a failure leaves it in RetryWait until DEPLOY_MAX_ATTEMPTS sends have failed, then fails it. A result for bytes no run is following (a push from before runs existed) is ignored.
get_run
get_schedule
holder
init_schema
list_runs
list_schedules
mark_interrupted
plugin_provenance
The plugin hashes recorded for a run, empty when it used no plugin.
record_plugin_provenance
Records which plugin programs a run used, as { "<plugin>": "<sha256 of the program>" } (R14). The hash is the install-time provenance re-checked at start, so a run row says which build of a plugin did the work even after the plugin is upgraded or removed. A second call for the same plugin replaces its hash; other plugins are kept.
transition_run
transition_run_fenced
Refuses a mutation from an executor whose lease has been superseded.
update_schedule_due