Repository navigation
Conversation
bburda
force-pushed
the
feat/rosbag-retention-0a
branch
from
December 1, 2026 15:43
aee4284 to
cd07db5
Compare
mfaferek93
reviewed
Dec 2, 2026
| } | ||
| } | ||
| for (const auto & path : candidates) { | ||
| if (!path_referenced(path)) { |
Collaborator
There was a problem hiding this comment.
path_referenced() returns false for any step() result other than SQLITE_ROW, so an I/O or corruption error on this COUNT reads as "no link left". If the COMMIT then goes through, a directory that another fault's committed row still names comes back in orphaned_paths and the caller removes it. COUNT(*) always yields a row on success, so path_referenced() could throw on anything else and roll the change set back.
bburda
force-pushed
the
feat/rosbag-retention-0a
branch
from
December 2, 2026 12:15
cd07db5 to
b116bde
Compare
…retention behaviour * test(fault_manager): pin rosbag retention against a real fault manager process * feat(fault_manager): add apply_rosbag_changes beside the rosbag mutators * ci: run the fault manager tests under ASan and TSan * test(fault_manager): wait for the earlier subscriber to leave before the next run * test(fault_manager): put multi-line docstring summaries on the second line * test(fault_manager): tighten the upsert, store-failure and race checks * ci: make the fault manager sanitizer job comments describe this job * test(fault_manager): rosbag test harness waits for the payload
bburda
force-pushed
the
feat/rosbag-retention-0a
branch
from
December 2, 2026 18:24
b116bde to
f2a3dde
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Issue 705 adds configurable rosbag retention. The rules will decide which recordings to keep, delete or replace. Today the retention logic is spread over several storage mutators, and each one changes rows in its own transaction. A rule that stores one recording and removes others needs one step that cannot stop half way.
This PR is the first of a stack. It does not change what the fault manager does.
What it adds:
FaultStorage::apply_rosbag_changes. It upserts rows, removes links and removes whole recordings in one transaction, and returns each path whose last link the call removed. It applies no per-fault cap and never deletes files. It is implemented for the in-memory, SQLite (BEGIN IMMEDIATE) and PostgreSQL backends. A change set that inserts and removes the same link throwsstd::invalid_argumentbefore any row changes.fault_manager_nodeas its own process and drive it over its ROS services. They pin the current behaviour: quota eviction order, a burst recording counted once and evicted whole, an oversized recording kept, the per-fault cap together with the quota, failing stores, a clear racing a store, shutdown during a post-fault window, and stale rows. The quota and clear flows also run against a PostgreSQL server.sanitizer-fault-managerCI job that builds the fault manager chain with ASan and with TSan and runs the package tests, launch tests included. The workspace sanitizer sweeps skip the package, as they dograph_watchdog.The existing mutators are unchanged and nothing calls the new primitive yet. The next PR (rosbag-retention-0b) builds on this one.
What changes for users
Nothing. No parameter, service, log line or default changes.
Issue
Type
Testing
colcon build --packages-up-to ros2_medkit_fault_manager(add--cmake-args -DPOSTGRES_SUPPORT=ONfor the PostgreSQL backend), thencolcon test --packages-select ros2_medkit_fault_managerandcolcon test-result --verbose.test_rosbag_quota.test.pyandtest_rosbag_quota_pg.test.pyinsrc/ros2_medkit_fault_manager/test/integration. Run them withctest -R rosbag. The PostgreSQL one needs a PostgreSQL server.test_rosbag_storage_parity.cpp.Checklist