Commit 4bcea88
committed
Rename RestartExecution/s to ClaimFunction/s and add owner-guarded SetFunction
The store's RestartExecution/RestartExecutions really take over ownership of a flow and hand back its current state, so rename them to ClaimFunction/ClaimFunctions across the IFunctionStore interface, all four stores and their SqlGenerators, the test doubles and the store test templates. The higher-level FlowsManager.RestartExecutions(messages) orchestration, InvocationHelper.RestartFunction and the RestartedFunction record keep their names; only their store calls are repointed.
Add IFunctionStore.SetFunction: an owner-guarded general state-setter that writes status, owner (null releases) and, when provided, the effects snapshot in a single UPDATE guarded by owner = expectedReplica. expectedReplica is non-nullable - the caller must already own the flow - matching the terminal writers. Its final IStorageSession? parameter is the store's forward-carried per-flow context (typically handed back by ClaimFunction); when supplied it is kept coherent with the persisted effect snapshot, mirroring each store's EffectsStore.SetEffectResults bookkeeping. Together with ClaimFunction this gives a claim-commit-release primitive without bespoke SQL.
Surface the flow's current result bytes on the claim result by adding Result to StoredFlowWithEffects (StorageSession kept last), populated from result_json (SQL stores) and the in-memory state, so a caller can pass it straight into SetFunction without nulling the result.
Build clean; InMemory 521 passed; ClaimFunction/SetFunction green on Postgres/SqlServer/MariaDB; full PostgreSQL suite 373 passed.1 parent c834dba commit 4bcea88
26 files changed
Lines changed: 1017 additions & 205 deletions
File tree
- Core
- Cleipnir.ResilientFunctions.Tests
- InMemoryTests
- TestTemplates
- WatchDogsTests
- Cleipnir.ResilientFunctions
- CoreRuntime
- Invocation
- Watchdogs
- Storage
- Samples/Sample.ConsoleApp/Utils
- Stores
- MariaDB
- Cleipnir.ResilientFunctions.MariaDB.Tests
- Cleipnir.ResilientFunctions.MariaDB
- PostgreSQL
- Cleipnir.ResilientFunctions.PostgreSQL.Tests
- Cleipnir.ResilientFunctions.PostgreSQL
- SqlServer
- Cleipnir.ResilientFunctions.SqlServer.Tests
- Cleipnir.ResilientFunctions.SqlServer
Lines changed: 30 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
82 | 102 | | |
Lines changed: 14 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
| 174 | + | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
215 | | - | |
216 | | - | |
| 219 | + | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | | - | |
220 | | - | |
| 223 | + | |
| 224 | + | |
221 | 225 | | |
222 | 226 | | |
223 | | - | |
224 | | - | |
| 227 | + | |
| 228 | + | |
225 | 229 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
| 617 | + | |
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| |||
0 commit comments