Commit 9fada81
committed
fix(connectors): require a lock to be held, owned, and heartbeated before sparing its log row
The previous round spared a sync-log row whose id was still the connector's lock
token. That is necessary but not sufficient: the reaper's reclaim filters out
archived and soft-deleted connectors, so their rows keep status syncing with an
intact token indefinitely and would have been spared forever. It also spared a
run that died without ever being reclaimed.
Keying on connector liveness alone has the opposite gap — it cannot tell which
run holds the lock, so an orphan on a connector that is immediately re-locked by
a replacement is spared until a tick happens to catch the connector idle.
Sparing now requires all three: the connector is locked, this row's run is the
holder, and that lock is being heartbeated. An orphan can satisfy at most two,
so no timing window strands one.
This is a per-row liveness predicate, not a restriction of the candidate set —
every stale row is still evaluated. A backlog row predating the token column
fails on two counts and still drains, so the sweep remains self-healing.1 parent 4b98668 commit 9fada81
2 files changed
Lines changed: 71 additions & 22 deletions
Lines changed: 49 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
218 | 228 | | |
219 | 229 | | |
220 | 230 | | |
221 | 231 | | |
222 | 232 | | |
223 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
224 | 236 | | |
225 | | - | |
226 | | - | |
227 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
228 | 241 | | |
229 | | - | |
| 242 | + | |
230 | 243 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 244 | + | |
| 245 | + | |
234 | 246 | | |
235 | | - | |
236 | | - | |
237 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
238 | 275 | | |
239 | 276 | | |
240 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
48 | | - | |
| 59 | + | |
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
52 | 63 | | |
53 | 64 | | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| |||
142 | 154 | | |
143 | 155 | | |
144 | 156 | | |
145 | | - | |
146 | | - | |
| 157 | + | |
| 158 | + | |
147 | 159 | | |
148 | 160 | | |
149 | 161 | | |
| |||
159 | 171 | | |
160 | 172 | | |
161 | 173 | | |
162 | | - | |
| 174 | + | |
163 | 175 | | |
164 | 176 | | |
165 | 177 | | |
| |||
0 commit comments