Commit b40af92
authored
[Snapshot-Agent Memory-Regions 2/N] Adding slots field to state-machine (#165)
* snapshot-agent: slot-aware snapshot/restore transitions in the state machine
StartSnapshotSlot/StartRestoreSlot extend StartSnapshot/StartRestore
with a named snapshot slot, recorded as the job's loaded slot on
success, for backends where several snapshots of one process coexist:
- restore while RUNNING only short-circuits to "already-running" when
the requested slot is the loaded one; a different slot proceeds (live
slot swap);
- a FAULTED job may be snapshotted or restored again, since faults are
typically transient (dead workload PID, timed-out checkpoint client)
and should not require an agent redeploy.
With slot == "" both entry points behave exactly like the existing
ones, and StartSnapshot/StartRestore now delegate to them, so current
backends (CUDA/app) are unchanged — pinned by slot_test.go alongside
the new slot-swap and fault-recovery coverage (gotest.tools joins
go.mod for it). Nothing calls the slot variants yet.
Signed-off-by: Edwinhr716 <edandres249@gmail.com>
* snapshot-agent: fold slot tests into the state-machine test tables
Review feedback on the slot slice: slot_test.go invented its own
conventions — one function per scenario, sequence-style drivers, and
gotest.tools asserts — next to a state-manager_test.go that already
does table-driven transitions with injected initial state. Since every
slot scenario reduces to a single transition once State and Slot are
seeded through the test exports, the coverage now lives in the
TestStartSnapshotSlot/TestStartRestoreSlot tables beside
TestStartSnapshot/TestStartRestore (same runner shape, plus slot
columns and an InternalJobSlot read-side export). Net new pin: a
failed worker leaves the previously loaded slot recorded.
gotest.tools leaves go.mod again.
Signed-off-by: Edwinhr716 <edandres249@gmail.com>
---------
Signed-off-by: Edwinhr716 <edandres249@gmail.com>1 parent a8b5611 commit b40af92
3 files changed
Lines changed: 317 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
85 | 101 | | |
86 | 102 | | |
87 | 103 | | |
| |||
94 | 110 | | |
95 | 111 | | |
96 | 112 | | |
97 | | - | |
98 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
99 | 118 | | |
100 | 119 | | |
101 | 120 | | |
| |||
132 | 151 | | |
133 | 152 | | |
134 | 153 | | |
| 154 | + | |
135 | 155 | | |
136 | 156 | | |
137 | 157 | | |
| |||
140 | 160 | | |
141 | 161 | | |
142 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
143 | 174 | | |
144 | 175 | | |
145 | 176 | | |
146 | 177 | | |
147 | 178 | | |
148 | 179 | | |
149 | 180 | | |
150 | | - | |
151 | | - | |
| 181 | + | |
| 182 | + | |
152 | 183 | | |
153 | 184 | | |
154 | 185 | | |
| |||
157 | 188 | | |
158 | 189 | | |
159 | 190 | | |
160 | | - | |
161 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
162 | 197 | | |
163 | 198 | | |
164 | 199 | | |
| |||
194 | 229 | | |
195 | 230 | | |
196 | 231 | | |
| 232 | + | |
197 | 233 | | |
198 | 234 | | |
199 | 235 | | |
| |||
0 commit comments