Skip to content

omdb: add facility for abandoning a saga #7791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gjcolombo
Copy link
Contributor

@gjcolombo gjcolombo commented Mar 13, 2025

Add an Abandoned saga state. This state disqualifies a saga from being picked up by Nexus saga recovery. (A running saga will continue running if it is Abandoned, and continued saga execution may end up clobbering the Abandoned state entirely.) Add an omdb subcommand to move a saga to this state (and refactor a bit to avoid duplicating code with the inject-error subcommand).

Tested (so far) by:

  • amending the datastore test that lists candidates for saga recovery
  • starting a demo saga in a dev cluster and verifying (via Nexus logs) that the saga is normally recovered when its Nexus is restarted (via svcadm restart), but is no longer recovered once abandoned (and can't be completed anymore); if I manually move the saga back to Running and restart its SEC again, the saga is picked up normally.

Fixes #7730.

Define an "abandoned" saga state. An abandoned saga will not begin to be
executed by any SEC. Technicians mark sagas as abandoned using omdb;
this requires the saga's current executor not to be running (otherwise
it could receive a state update from Steno that will clobber the
Abandoned state).

This commit defines the new state in the database schema and fixes up
the DB crates accordingly, but adds no affordances for applying the new
saga state or considering it when deciding what sagas to recover.
@gjcolombo gjcolombo force-pushed the gjcolombo/abandon-ship branch from 397d5d7 to f1868f0 Compare April 9, 2025 22:13
@gjcolombo gjcolombo marked this pull request as ready for review April 9, 2025 22:16
@gjcolombo gjcolombo requested review from davepacheco and jmpesp April 9, 2025 22:16
@gjcolombo
Copy link
Contributor Author

I've rebased onto the latest main and retested as noted in the PR description. I feel like I might be under-testing this a bit, so am especially open to suggestions for other things to try here.

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.

want a tool for saga abandonment
1 participant