Skip to content

docs: say what clearing a fault deletes, and that a device de-assert is a clear - #677

Merged
bburda merged 3 commits into
mainfrom
docs/snapshot-deletion-rule
Sep 12, 2026
Merged

docs: say what clearing a fault deletes, and that a device de-assert is a clear#677
bburda merged 3 commits into
mainfrom
docs/snapshot-deletion-rule

Conversation

@bburda

@bburda bburda commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

The snapshots tutorial note said snapshots.retain_on_clear: true keeps everything a fault captured, and named DELETE /api/v1/faults/{code} as the clear, a route the gateway does not serve.

The note now says a clear deletes the value snapshots and that retain_on_clear covers only those. The recording goes under snapshots.rosbag.auto_cleanup, unless that is off or snapshots.rosbag.max_bags_per_fault keeps a history. It names the per-fault and bulk DELETE routes, the ~/clear_fault service and the correlation cascade as examples of a clear, and says a plugin calls that service when its device de-asserts an alarm.

Code behind the text: retain_snapshots_on_clear_ in sqlite_fault_storage.cpp guards only DELETE FROM snapshots. RosbagCapture::on_fault_cleared deletes the recording under auto_cleanup.

The same claim in the fault manager, gateway and OPC UA READMEs and in the shipped snapshots.yaml is corrected.

Issue

Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

Docs only. From docs/, both clean:

sphinx-build -b linkcheck . _build/linkcheck
sphinx-build -b html . _build/html -W --keep-going

pre-commit passes.

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

The snapshots tutorial said a clear deletes "snapshots" and pointed at a
DELETE /api/v1/faults/{code} endpoint that is not registered. Two things
were wrong. retain_on_clear scopes to the value snapshots only, and the
rosbag recording is governed by rosbag.auto_cleanup, with
rosbag.max_bags_per_fault taking over the retention decision once a history
is configured. The per-fault DELETE route is entity-scoped.

Name the service a plugin calls when its device de-asserts an alarm too, so
a device going quiet reads as the clear it is, and qualify the same rule
where it was repeated in the fault manager, gateway and OPC UA READMEs and
in the shipped snapshots.yaml.
… clears

on_fault_cleared returns on either gate, so a de-assert leaves the recording
alone when auto_cleanup is off as well as when max_bags_per_fault keeps a
history. The OPC UA README named only the second one.

The snapshots note read as an exhaustive list of the ways a fault gets
cleared, which the "there is no global DELETE /api/v1/faults/{code}" sentence
reinforced. The bulk DELETE routes, the correlation cascade clearing a root
cause's symptoms, and the startup reclassification of HEALED rows all reach
the same storage path, so name the routes as examples and keep the one true
absence. Also bound the max_bags_per_fault claim: at 0 the cap is unlimited
and only max_total_storage_mb holds the recordings back.
@bburda bburda self-assigned this Sep 10, 2026
@bburda
bburda marked this pull request as ready for review September 10, 2026 20:09
Comment thread docs/tutorials/snapshots.rst Outdated
The OPC UA plugin calls clear_fault when a threshold alarm de-asserts. A
native AlarmCondition stays CONFIRMED until the operator acknowledges it
and, unless require_confirm_for_clear is off, confirms it. A plugin that
de-asserts with a PASSED report, as the graph watchdog does, goes through
debounce and healing, where nothing deletes snapshots: with
healing_enabled the fault heals once its counter reaches
healing_threshold, and with the default it stays CONFIRMED.
@bburda
bburda merged commit 3738f08 into main Sep 12, 2026
35 of 50 checks passed
@bburda
bburda deleted the docs/snapshot-deletion-rule branch September 12, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: the snapshot deletion note does not say a rosbag recording is outside retain_on_clear, or that a device de-assert is a clear

2 participants