v0.8.0
v0.8.0: mutexes, operation records, one Failure, and the failure reducer
Eight changes since v0.7.0. Four reshape contracts and set this release's migration section; four are additive.
-
Mutexes replace exclusion groups (#67). A pipeline names any number of
mutexes; a run holds each on itsResourceIDfrom admission to terminality, and two pipelines exclude each other exactly when they share a name. Exclusion is pairwise, so a snapshot pipeline can exclude both a deploy and a backup while deploys and backups run together. Still an admission rule resolved atStart, never persisted, so changes converge on their own. -
Operation records (#70). A step's forward execution and its unwind are two rows, each written once when it resolves, carrying status, attempts, the committed state (forward only), the permanent failure that resolved it, and its resolution order. An unwind never rewrites the forward row's state, and nothing in the bbolt driver is read back to be rewritten.
Result.UnwindFailuresis gone; the per-step facts live in the store. -
One
Failuretype (#71).FailureRecord,RootFailure, andUnwindFailurecollapse intoFailure; the role is where the value sits. A run's failure isResult.Failure,Status.Failure(set from the moment the run starts unwinding), andInvocation.Failure(). The aggregate handler-side struct and the unwind-failure list are gone from the handler contract. -
Failure reducer (#72). A pipeline may declare
failure_output; aFailureReducerfolds the input, the committed states, the run'sFailure, and the per-stepUnwindFailure(step)into it when the unwind completes, and the typedResultexposes it asFailureOutput(). The snapshots example reports the object a jammed storage backend left behind. -
Additive: generated
NewXxxInvocation(core)andXxxReducer.Reduce(view)sodurabletest.NewInvocationdrives generated handlers and reducers directly (#64); durableotel unwind spans carrydurable.run_failure.step,.kind, and.reason(#65);WithTextLimitbounds every free text the engine records, default 4096 bytes (#68); option names follow what they configure (#66).
Breaking changes and migration
- Protos:
exclusion_group: "x"ismutexes: "x"(field 5 reserved). Hand-written configs:ExclusionGroup: "x"isMutexes: []string{"x"}. - Options:
engine.WithRetentionisWithRetentionPolicy;durableotel.WithBaggageisWithBaggagePropagation.WithObserverandWithScheduleAnnotatorare variadic; single-argument calls compile unchanged. - Failure types:
durable.RootFailure,UnwindFailure, andFailureRecordaredurable.Failure.res.RootFailureisres.Failure;inv.Failure().Root.Xisinv.Failure().X;inv.Failure().UnwindFailureshas no replacement on the invocation, andResult.UnwindFailuresis gone. Read per-step unwind failures in a failure reducer throughUnwindFailure(step). - Typed invocations gain
Failure()andLogger(); third-party fakes ofdurable.Invocationmust addFailure(), and fakes ofdurable.ReduceViewmust addFailure()andUnwindFailure(StepID). - Store SPI (
store/driver):OperationRecord,StepRecord{Forward, Unwind},OpWrite{StepID, Phase, Record},Transition.Ops;Transition.UnwindFailureandRunRecord.UnwindFailures(the field) are gone,RunRecord.RootFailureisFailure, andRunRecord.UnwindFailures()is a derived view. - bbolt on-disk layout changed with no migration: a database written by v0.7.0 or earlier is not readable by this driver. Discard it.
- Storage proto: the
StepRecordandFailuresmessages are replaced byOperationRecord; buf'sMESSAGE_NO_DELETEis excepted for the internal schema.
contrib/durableotel v0.8.0 is released in lockstep.
Modules
github.com/dangra/durable@v0.8.0github.com/dangra/durable/contrib/durableotel@v0.8.0
What's Changed
- codegen: typed invocation constructors and Reducer.Reduce for engine-free tests by @dangra in #64
- durableotel: unwind spans carry the failure being unwound by @dangra in #65
- Option names follow what they configure by @dangra in #66
- Exclusion groups become mutexes by @dangra in #67
- Bound the free text the engine records on a run by @dangra in #68
- Operation records: one row per step phase, carrying its own failure by @dangra in #70
- One Failure type; Status carries the Run's failure from the start of unwind by @dangra in #71
- Failure reducer: a typed account of a failed run by @dangra in #72
- Release v0.8.0 by @dangra in #73
Full Changelog: v0.7.0...v0.8.0